From fd8189932147a524fe43532b46baa35e8be92a1b Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Fri, 19 Jul 2013 21:34:21 +0200 Subject: [PATCH] dsicinav: Clip the source size to the expected maximum 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c index afcb8ef7ff..85148ea5ae 100644 --- a/libavcodec/dsicinav.c +++ b/libavcodec/dsicinav.c @@ -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) {