]> git.sesse.net Git - ffmpeg/commitdiff
bfi: fix division by 0
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 11 Dec 2012 23:00:25 +0000 (00:00 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 12 Dec 2012 00:22:09 +0000 (01:22 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/bfi.c

index d26d848a15e967d0b430f8bee2fe72bc73da9d52..fd08e39f7993b83d2ee5bb11b93e656307775cbb 100644 (file)
@@ -150,7 +150,7 @@ static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
             return ret;
 
         pkt->pts          = bfi->video_frame;
-        bfi->video_frame += ret / bfi->video_size;
+        bfi->video_frame += bfi->video_size ? ret / bfi->video_size : 1;
 
         /* One less frame to read. A cursory decrement. */
         bfi->nframes--;