aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-09-15 22:00:47 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-05 23:19:39 +0200
commitbea287bdadd13b8045f6c043950ee5a405c3d768 (patch)
tree472678e5ebcadd641b95cfc9c234b995daa74a62
parent2a7b3e62e0274f359ee1420f1d765292beb0508b (diff)
downloadffmpeg-bea287bdadd13b8045f6c043950ee5a405c3d768.tar.gz
avcodec/apedec: Fix integer overflow in intermediate
Fixes: signed integer overflow: 559334865 * 4 cannot be represented in type 'int' Fixes: 37929/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6751932295806976 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 90da43557f7257d72e95504f63ae6504406d6eab) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/apedec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 6df958eed6..181b7fe22d 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1337,7 +1337,7 @@ static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
absres = FFABSU(res);
if (absres)
*f->adaptcoeffs = APESIGN(res) *
- (8 << ((absres > f->avg * 3) + (absres > f->avg * 4 / 3)));
+ (8 << ((absres > f->avg * 3) + (absres > (f->avg + f->avg / 3))));
/* equivalent to the following code
if (absres <= f->avg * 4 / 3)
*f->adaptcoeffs = APESIGN(res) * 8;