Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-29 21:12:23 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-22 01:44:49 +0300
commit70bf2bdf3112e93726eb93d02df02f964cb46596 (patch)
treec04553aef62db066ce5d14986e2c5a5ef5346946
parented04ecd2d3c3b6dcd7ff31564d93ebe7567fa6ce (diff)
avcodec/iff: Move index use after check in decodeplane8()
Fixes: index 9 out of bounds for type 'const uint64_t [8][256]' Fixes: 18409/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5767030560522240 Fixes: 18720/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5651995784642560 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a1f8b36cc45406f66aac635a4db32d2a5cc29f43) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/iff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 3d9ce9d29c..8a2ae2542d 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -456,11 +456,12 @@ 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];
+ const uint64_t *lut;
if (plane >= 8) {
av_log(NULL, AV_LOG_WARNING, "Ignoring extra planes beyond 8\n");
return;
}
+ lut = plane8_lut[plane];
do {
uint64_t v = AV_RN64A(dst) | lut[*buf++];
AV_WN64A(dst, v);