Commit 0ca354eb authored by Sangkyu Park's avatar Sangkyu Park Committed by Luis de Bethencourt
Browse files

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
parent e09cf2f3
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment