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
This commit is contained in:
Philip Jägenstedt 2010-05-12 14:30:18 +02:00 committed by Sebastian Dröge
parent 9dc7889eea
commit d146971128

View file

@ -4531,6 +4531,12 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
&data_len)) != GST_FLOW_OK)
break;
if (G_UNLIKELY (stream == NULL)) {
GST_WARNING_OBJECT (demux,
"Unexpected CodecState subelement - ignoring");
break;
}
g_free (stream->codec_state);
stream->codec_state = data;
stream->codec_state_size = data_len;