From b03fdec9a5e68c5af94508cd24e5f501083f57f5 Mon Sep 17 00:00:00 2001 From: phintuka Date: Tue, 29 Dec 2009 19:57:00 +0000 Subject: get_optional_data(): Fixed segfault when data pointer is NULL (Thanks to Julian Scheel) --- xine/BluRay/input_bluray.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c index cf96b935..0865b557 100644 --- a/xine/BluRay/input_bluray.c +++ b/xine/BluRay/input_bluray.c @@ -344,9 +344,8 @@ static const char* bluray_plugin_get_mrl (input_plugin_t *this_gen) static int bluray_plugin_get_optional_data (input_plugin_t *this_gen, void *data, int data_type) { bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen; - int channel = *((int *)data); - if (!this || !this->stream) + if (!this || !this->stream || !data) return INPUT_OPTIONAL_UNSUPPORTED; switch (data_type) { @@ -365,7 +364,8 @@ static int bluray_plugin_get_optional_data (input_plugin_t *this_gen, void *data */ case INPUT_OPTIONAL_DATA_AUDIOLANG: if (this->nav_title) { - CLPI_PROG *prog = &this->nav_title->clip_list.clip->cl->program.progs[0]; + int channel = *((int *)data); + CLPI_PROG *prog = &this->nav_title->clip_list.clip->cl->program.progs[0]; int i, n = 0; for (i=0 ; i < prog->num_streams; i++) if (prog->streams[i].pid >= 0x1100 && prog->streams[i].pid < 0x1200) { @@ -389,7 +389,8 @@ static int bluray_plugin_get_optional_data (input_plugin_t *this_gen, void *data */ case INPUT_OPTIONAL_DATA_SPULANG: if (this->nav_title) { - CLPI_PROG *prog = &this->nav_title->clip_list.clip->cl->program.progs[0]; + int channel = *((int *)data); + CLPI_PROG *prog = &this->nav_title->clip_list.clip->cl->program.progs[0]; int i, n = 0; for (i=0 ; i < prog->num_streams; i++) if (prog->streams[i].pid >= 0x1200 && prog->streams[i].pid < 0x1300 && -- cgit v1.2.3