+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:
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:
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;