aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-09-17 21:40:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-26 17:22:42 +0200
commit0e45886e6ea272f453cb949e95c3bfd8380974c5 (patch)
treefd67bb22ae57d6a92d9f489f669d5d5ffa00f813
parent8e67cfe15b062362cdc22be2a31167efc55b1e13 (diff)
downloadffmpeg-0e45886e6ea272f453cb949e95c3bfd8380974c5.tar.gz
avcodec/apedec: Fix integer overflow in filter_fast_3320()
Fixes: signed integer overflow: 2145649668 + 3956526 cannot be represented in type 'int' Fixes: 38351/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4647077926273024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg 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 050523601d..27d0ff3565 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -879,7 +879,7 @@ static av_always_inline int filter_fast_3320(APEPredictor *p,
}
predictionA = p->buf[delayA] * 2U - p->buf[delayA - 1];
- p->lastA[filter] = decoded + ((int32_t)(predictionA * p->coeffsA[filter][0]) >> 9);
+ p->lastA[filter] = decoded + (unsigned)((int32_t)(predictionA * p->coeffsA[filter][0]) >> 9);
if ((decoded ^ predictionA) > 0)
p->coeffsA[filter][0]++;