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
This commit is contained in:
Sangkyu Park 2015-06-26 15:58:25 +09:00 committed by Luis de Bethencourt
parent e09cf2f3b6
commit 0ca354eb10

5
gst/mpegdemux/gstmpegdemux.c Normal file → Executable file
View file

@ -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);