From 0f23b0aa5f3526ab09caab665337c0ed3217caec Mon Sep 17 00:00:00 2001 From: phintuka Date: Sun, 19 Jun 2011 21:15:13 +0000 Subject: Check if optional data is NULL before using it --- xine/BluRay/demux_ts.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xine/BluRay/demux_ts.c b/xine/BluRay/demux_ts.c index 6b18b72d..0010831b 100644 --- a/xine/BluRay/demux_ts.c +++ b/xine/BluRay/demux_ts.c @@ -2388,12 +2388,13 @@ static int demux_ts_get_optional_data(demux_plugin_t *this_gen, { demux_ts_t *this = (demux_ts_t *) this_gen; char *str = data; - int channel = *((int *)data); /* be a bit paranoid */ - if (this == NULL || this->stream == NULL) + if (this == NULL || this->stream == NULL || data == NULL) return DEMUX_OPTIONAL_UNSUPPORTED; + int channel = *((int *)data); + switch (data_type) { case DEMUX_OPTIONAL_DATA_AUDIOLANG: -- cgit v1.2.3