Check for out of bounds reads in the Delphine Software International CIN decoder.
authorLaurent Aimar <fenrir@videolan.org>
Thu, 29 Sep 2011 22:05:50 +0000 (00:05 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Sep 2011 00:09:57 +0000 (02:09 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dsicinav.c

index 27f4204..691b597 100644 (file)
@@ -217,6 +217,8 @@ static int cinvideo_decode_frame(AVCodecContext *avctx,
     bitmap_frame_size = buf_size - 4;
 
     /* handle palette */
+    if (bitmap_frame_size < palette_colors_count * (3 + (palette_type != 0)))
+        return AVERROR_INVALIDDATA;
     if (palette_type == 0) {
         for (i = 0; i < palette_colors_count; ++i) {
             cin->palette[i] = bytestream_get_le24(&buf);