diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-30 00:05:50 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-01 20:54:17 +0200 |
commit | 18cfe0238df259e4b541d28b465688bea4781b16 (patch) | |
tree | 4123b8a923bf5c2348920ff9f0e12c92e8277cb2 | |
parent | 603cb031f19bff898b99fca2234f4cebbcfd743c (diff) | |
download | ffmpeg-18cfe0238df259e4b541d28b465688bea4781b16.tar.gz |
Check for out of bounds reads in the Delphine Software International CIN decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8e5f093c2cf13eab3d68d893bf8f30c56ba4e733)
-rw-r--r-- | libavcodec/dsicinav.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c index f12560714a..c33b3edc4c 100644 --- a/libavcodec/dsicinav.c +++ b/libavcodec/dsicinav.c @@ -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); |