diff options
author | Philip Jägenstedt <philipj@opera.com> | 2010-10-20 13:28:28 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-10-23 14:05:46 +0100 |
commit | 6cf398cdf30a65481ec160165048c4396cff76f7 (patch) | |
tree | d2a85dfa16f4235173b2fae3b958de9a947d9803 | |
parent | 631e2aa043b7f2da9239dda89dd5c5c3fdec672d (diff) |
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
-rw-r--r-- | gst/matroska/matroska-demux.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 959fb6806..bdaafa8fe 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; |