From 0ca354eb102d883d0bc4cb9762c8911ccf698ffc Mon Sep 17 00:00:00 2001 From: Sangkyu Park Date: Fri, 26 Jun 2015 15:58:25 +0900 Subject: [PATCH] mpegdemux: check pointer before dereferencing gst_ps_demux_get_stream() could return NULL when it is unknown stream, check this hasn't happened before dereferencing the returned pointer. https://bugzilla.gnome.org/show_bug.cgi?id=751528 --- gst/mpegdemux/gstmpegdemux.c | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 gst/mpegdemux/gstmpegdemux.c diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c old mode 100644 new mode 100755 index ab9b36465d..eb2848bf24 --- a/gst/mpegdemux/gstmpegdemux.c +++ b/gst/mpegdemux/gstmpegdemux.c @@ -822,6 +822,9 @@ gst_ps_demux_handle_dvd_event (GstPsDemux * demux, GstEvent * event) continue; } + if (temp == NULL) + continue; + g_snprintf (cur_stream_name, 32, "audio-%d-language", i); lang_code = gst_structure_get_string (structure, cur_stream_name); if (lang_code) { @@ -855,6 +858,8 @@ gst_ps_demux_handle_dvd_event (GstPsDemux * demux, GstEvent * event) /* Retrieve the subpicture stream to force pad creation */ temp = gst_ps_demux_get_stream (demux, 0x20 + stream_id, ST_PS_DVD_SUBPICTURE); + if (temp == NULL) + continue; g_snprintf (cur_stream_name, 32, "subpicture-%d-language", i); lang_code = gst_structure_get_string (structure, cur_stream_name);