]> git.sesse.net Git - ffmpeg/commitdiff
movdec: Fix bad computed size for atoms with size 0 in MOV files
authorMihnea Balta <mihnea.balta@gmail.com>
Tue, 6 Dec 2011 07:29:47 +0000 (09:29 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 6 Dec 2011 16:31:17 +0000 (17:31 +0100)
The computed size doesn't contain the header size because it's already
skipped by incrementing total_size, but then it's skipped again in the
last line. The atom comes out 8 bytes short and the function
mov_read_chan() aborts the whole parsing process. I think the computed
size should be atom.size - total_size + 8.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mov.c

index eb3159230856d5040de89f37a245b696f6047631..d96ab0488db0551e14027c558f8393df61c15a03 100644 (file)
@@ -323,7 +323,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
             total_size += 8;
         }
         if (a.size == 0) {
-            a.size = atom.size - total_size;
+            a.size = atom.size - total_size + 8;
             if (a.size <= 8)
                 break;
         }