From: Mark Nauwelaerts Date: Mon, 1 Oct 2012 13:44:01 +0000 (+0200) Subject: avidemux: push mode; handle some initial junk before hdrl list X-Git-Tag: 1.19.3~509^2~6485 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b10829d6c859fb2aa30897186710802d4ec88571;p=platform%2Fupstream%2Fgstreamer.git avidemux: push mode; handle some initial junk before hdrl list Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685059 --- diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 434c650..cf88fbd 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -3209,6 +3209,7 @@ gst_avi_demux_stream_header_push (GstAviDemux * avi) switch (avi->header_state) { case GST_AVI_DEMUX_HEADER_TAG_LIST: + again: if (gst_avi_demux_peek_chunk (avi, &tag, &size)) { avi->offset += 8 + GST_ROUND_UP_2 (size); if (tag != GST_RIFF_TAG_LIST) @@ -3221,8 +3222,12 @@ gst_avi_demux_stream_header_push (GstAviDemux * avi) gst_buffer_extract (buf, 0, fourcc, 4); - if (GST_READ_UINT32_LE (fourcc) != GST_RIFF_LIST_hdrl) - goto header_no_hdrl; + if (GST_READ_UINT32_LE (fourcc) != GST_RIFF_LIST_hdrl) { + GST_WARNING_OBJECT (avi, "Invalid AVI header (no hdrl at start): %" + GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag)); + gst_buffer_unref (buf); + goto again; + } /* mind padding */ if (size & 1) @@ -3441,14 +3446,6 @@ header_no_list: GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag))); return GST_FLOW_ERROR; } -header_no_hdrl: - { - GST_ELEMENT_ERROR (avi, STREAM, DEMUX, (NULL), - ("Invalid AVI header (no hdrl at start): %" - GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag))); - gst_buffer_unref (buf); - return GST_FLOW_ERROR; - } header_no_avih: { GST_ELEMENT_ERROR (avi, STREAM, DEMUX, (NULL),