aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/iff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-13 10:48:14 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-03 12:10:24 +0200
commit99d2024b18771ca9b6db4e917386b7775101fd1e (patch)
tree0c4ac485bbe9490bc210b43f30a1a834efd5cb4e /libavcodec/iff.c
parentc15b6bfd79aad440a19ca8e7ab3f06c37d882e6c (diff)
downloadffmpeg-99d2024b18771ca9b6db4e917386b7775101fd1e.tar.gz
avcodec/iff: Fix off by x error
Fixes: out of array access Fixes: 23245/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5723121327013888.fuzz 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 51225dee0a6266780d26d43bd6802bbcf736327e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/iff.c')
-rw-r--r--libavcodec/iff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index f094b4b548..6ec2dd60ad 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -723,7 +723,7 @@ static void decode_deep_rle32(uint8_t *dst, const uint8_t *src, int src_size, in
if (opcode >= 0) {
int size = opcode + 1;
for (i = 0; i < size; i++) {
- int length = FFMIN(size - i, width);
+ int length = FFMIN(size - i, width - x);
if (src_end - src < length * 4)
return;
memcpy(dst + y*linesize + x * 4, src, length * 4);