diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-27 17:19:36 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-06 11:30:43 +0100 |
commit | 4d392fc27ca805761cc4ee89147fbd0df6713f65 (patch) | |
tree | d9491d4da59c3ce7a1d14f0a1ceecd965634ace9 | |
parent | fa9ca0b663c1768ab2a537f5a48a4eb35e66b447 (diff) | |
download | ffmpeg-4d392fc27ca805761cc4ee89147fbd0df6713f65.tar.gz |
avcodec/apedec: Fix integer overflow in predictor_update_3930()
Fixes: signed integer overflow: -69555262 * 31 cannot be represented in type 'int'
Fixes: 17698/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5728970447781888
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 5c072c9ed7c6f173b8a0a886fb7fe1e8e4c1fadd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/apedec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 0e1336b832..9f1e8123b7 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -1051,7 +1051,7 @@ static av_always_inline int predictor_update_3930(APEPredictor *p, d3 * p->coeffsA[filter][3]; p->lastA[filter] = decoded + (predictionA >> 9); - p->filterA[filter] = p->lastA[filter] + ((p->filterA[filter] * 31) >> 5); + p->filterA[filter] = p->lastA[filter] + ((int)(p->filterA[filter] * 31U) >> 5); sign = APESIGN(decoded); p->coeffsA[filter][0] += ((d0 < 0) * 2 - 1) * sign; |