diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gst/qtdemux/qtdemux.c | 17 |
2 files changed, 26 insertions, 0 deletions
@@ -1,3 +1,12 @@ +2008-09-17 Edward Hervey <edward.hervey@collabora.co.uk> + + * gst/qtdemux/qtdemux.c: (gst_qtdemux_loop_state_header), + (gst_qtdemux_chain): + Some 'broken' files out there have atom lengths of zero... + which basically results in qtdemux consuming that atom again and again + until the *end of night* ! + Detect that and emits an adequate element error message. + 2008-09-17 Jan Schmidt <jan.schmidt@sun.com> * gst/interleave/Makefile.am: diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 63ba038e..f0b89d50 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -1089,6 +1089,15 @@ gst_qtdemux_loop_state_header (GstQTDemux * qtdemux) extract_initial_length_and_fourcc (GST_BUFFER_DATA (buf), &length, &fourcc); gst_buffer_unref (buf); + if (length == 0) { + GST_ELEMENT_ERROR (qtdemux, STREAM, DECODE, + (_("This file is invalid and cannot be played.")), + ("Header atom '%" GST_FOURCC_FORMAT "' has empty length", + GST_FOURCC_ARGS (fourcc))); + ret = GST_FLOW_ERROR; + goto beach; + } + switch (fourcc) { case FOURCC_mdat: case FOURCC_free: @@ -2092,6 +2101,14 @@ gst_qtdemux_chain (GstPad * sinkpad, GstBuffer * inbuf) GST_DEBUG_OBJECT (demux, "Peeking found [%" GST_FOURCC_FORMAT "] size: %u", GST_FOURCC_ARGS (fourcc), (guint) size); + if (size == 0) { + GST_ELEMENT_ERROR (demux, STREAM, DECODE, + (_("This file is invalid and cannot be played.")), + ("initial atom '%" GST_FOURCC_FORMAT "' has empty length", + GST_FOURCC_ARGS (fourcc))); + ret = GST_FLOW_ERROR; + break; + } if (fourcc == FOURCC_mdat) { if (demux->n_streams > 0) { demux->state = QTDEMUX_STATE_MOVIE; |