aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-09-11 00:30:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-10-21 22:19:37 +0200
commit75353c4b693ac462fbcb54d95522f58708784afd (patch)
treed888e682d5dece4081b3bbf4b5ee09b198c32eee
parentbce93faf38a0db31ad314ce8eb9488970580309d (diff)
downloadffmpeg-75353c4b693ac462fbcb54d95522f58708784afd.tar.gz
avcodec/apedec: Fix integer overflow in filter_3800()
Fixes: signed integer overflow: -2147448926 + -198321 cannot be represented in type 'int' Fixes: 48798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5739619273015296 Fixes: 48798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6744428485672960 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 f05247f6a4698c14f1cd523daa90188f50dcf6ad) 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 07128777ab..619683bfce 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -880,7 +880,7 @@ static av_always_inline int filter_3800(APEPredictor *p,
p->coeffsB[filter][0] += (((d3 >> 29) & 4) - 2) * sign;
p->coeffsB[filter][1] -= (((d4 >> 30) & 2) - 1) * sign;
- p->filterB[filter] = p->lastA[filter] + (predictionB >> shift);
+ p->filterB[filter] = p->lastA[filter] + (unsigned)(predictionB >> shift);
p->filterA[filter] = p->filterB[filter] + (unsigned)((int)(p->filterA[filter] * 31U) >> 5);
return p->filterA[filter];