aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-05-10 12:04:05 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit4a41de80ed1578a5f4837be1479116dd5b2137bb (patch)
tree0d4c39133c37acf0c0adc70dc2014a1c1d088339
parent6ce730d39e013211c7288938595fba48952d2edc (diff)
downloadffmpeg-4a41de80ed1578a5f4837be1479116dd5b2137bb.tar.gz
avcodec/iff: Fix several integer overflows
Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int32_t' (aka 'int') Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5764066459254784 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 7a92147f87129851c1cc2c15f4ba714b8cf23f71) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/iff.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index b038436f79..c5c6dceb20 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -1305,11 +1305,10 @@ static void decode_delta_d(uint8_t *dst,
opcode--;
}
} else {
- opcode = -opcode;
while (opcode && bytestream2_get_bytes_left(&gb) > 0) {
bytestream2_put_be32(&pb, bytestream2_get_be32(&gb));
bytestream2_skip_p(&pb, pitch - 4);
- opcode--;
+ opcode++;
}
}
entries--;