Commit d1469711 authored by Philip Jägenstedt's avatar Philip Jägenstedt Committed by Sebastian Dröge

matroskademux: Ignore unexpected CodecState

Because GstMatroskaTrackContext *stream is set up in the first
SimpleBlock or Block, a rogue CodecState otherwise causes a segfault on
derefencing the NULL pointer. Test case:
bug_s5506167_r0.001____gst_matroska_demux_parse_blockgroup_or_simpleblock.webm
parent 9dc7889e
...@@ -4531,6 +4531,12 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux, ...@@ -4531,6 +4531,12 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
&data_len)) != GST_FLOW_OK) &data_len)) != GST_FLOW_OK)
break; break;
if (G_UNLIKELY (stream == NULL)) {
GST_WARNING_OBJECT (demux,
"Unexpected CodecState subelement - ignoring");
break;
}
g_free (stream->codec_state); g_free (stream->codec_state);
stream->codec_state = data; stream->codec_state = data;
stream->codec_state_size = data_len; stream->codec_state_size = data_len;
......
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