dsicinav: Clip the source size to the expected maximum
authorLuca Barbato <lu_zero@gentoo.org>
Fri, 19 Jul 2013 19:34:21 +0000 (21:34 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 19 Jul 2013 20:14:07 +0000 (22:14 +0200)
A packet larger than cin->bitmap_size does not make sense.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
libavcodec/dsicinav.c

index afcb8ef..85148ea 100644 (file)
@@ -243,6 +243,8 @@ static int cinvideo_decode_frame(AVCodecContext *avctx,
         }
     }
 
+    bitmap_frame_size = FFMIN(cin->bitmap_size, bitmap_frame_size);
+
     /* note: the decoding routines below assumes that
      * surface.width = surface.pitch */
     switch (bitmap_frame_type) {