]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dsicinav.c
eamad: release the reference frame on video size changes
[ffmpeg] / libavcodec / dsicinav.c
index 27f42041ba0c844a29006518fcd71f96e7983d96..05d9e4cc1411ef24228cbec09bbd0ebdd15ce3a0 100644 (file)
@@ -217,7 +217,11 @@ 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) {
+        if (palette_colors_count > 256)
+            return AVERROR_INVALIDDATA;
         for (i = 0; i < palette_colors_count; ++i) {
             cin->palette[i] = bytestream_get_le24(&buf);
             bitmap_frame_size -= 3;