matroskademux: don't crash if vorbis/theora codec data is missing

Error out properly in this case instead of crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=632682
This commit is contained in:
Philip Jägenstedt 2010-10-20 13:28:28 +02:00 committed by Tim-Philipp Müller
parent 631e2aa043
commit 6cf398cdf3

View file

@ -4263,6 +4263,12 @@ gst_matroska_demux_push_xiph_codec_priv_data (GstMatroskaDemux * demux,
gint i, offset, num_packets;
guint *length, last;
if (stream->codec_priv == NULL || stream->codec_priv_size == 0) {
GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL),
("Missing codec private data for xiph headers, broken file"));
return GST_FLOW_ERROR;
}
/* start of the stream and vorbis audio or theora video, need to
* send the codec_priv data as first three packets */
num_packets = p[0] + 1;