avformat/avidec: Workaround broken initial frame
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 15 Sep 2015 02:01:27 +0000 (04:01 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 9 Oct 2015 23:14:12 +0000 (01:14 +0200)
Fixes Ticket4851

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e2ef00394b8079e93835d47c993868229f07502)

Conflicts:
libavformat/avidec.c

libavformat/avidec.c

index 1d5e3ba..9a4f881 100644 (file)
@@ -1330,7 +1330,8 @@ static int avi_read_idx1(AVFormatContext *s, int size)
         ast = st->priv_data;
 
         if (first_packet && first_packet_pos) {
-            data_offset = first_packet_pos - pos;
+            if (avi->movi_list + 4 != pos || pos + 500 > first_packet_pos)
+                data_offset  = first_packet_pos - pos;
             first_packet = 0;
         }
         pos += data_offset;