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>
Sat, 24 Aug 2013 10:17:39 +0000 (12:17 +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
(cherry picked from commit fd8189932147a524fe43532b46baa35e8be92a1b)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/dsicinav.c

index 7f5c1da..772fb8d 100644 (file)
@@ -244,6 +244,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) {