From 6cf398cdf30a65481ec160165048c4396cff76f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Wed, 20 Oct 2010 13:28:28 +0200 Subject: [PATCH] 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 --- gst/matroska/matroska-demux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 959fb68061..bdaafa8fea 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -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;