diff options
author | Edward Hervey <bilboed@bilboed.com> | 2008-09-17 14:50:42 +0000 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2008-09-17 14:50:42 +0000 |
commit | 53a576bb6fca5cfd619071835e201887177270c5 (patch) | |
tree | 1b5c1a621791fb6eed0c8670c308c7f54f481d29 | |
parent | a236a2df36c16bbb05d4479047ef437f1356f841 (diff) |
gst/qtdemux/qtdemux.c: Some 'broken' files out there have atom lengths of zero... which basically results in qtdemux ...
Original commit message from CVS:
* 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.
-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; |