diff options
author | Michael Niedermayer | 2012-11-09 17:47:51 +0100 |
---|---|---|
committer | Michael Niedermayer | 2012-11-09 17:47:51 +0100 |
commit | fb6a72cde52580bc92c92c8f02bb3eb7afb3fd71 (patch) | |
tree | a10346883ebbc3e172b96bd3a4a82dc2f58ae98d | |
parent | 7989f7e0b5229e618a7f6bf97c6608090a7db106 (diff) |
iff: avoid out of array reads, due to too many planes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/iff.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c index bc88a8e45b..d5c1457de1 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -371,6 +371,10 @@ static av_cold int decode_init(AVCodecContext *avctx) static void decodeplane8(uint8_t *dst, const uint8_t *buf, int buf_size, int plane) { const uint64_t *lut = plane8_lut[plane]; + if (plane >= 8) { + av_log(0, AV_LOG_WARNING, "Ignoring extra planes beyond 8\n"); + return; + } do { uint64_t v = AV_RN64A(dst) | lut[*buf++]; AV_WN64A(dst, v); |