diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-21 00:26:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-31 19:51:56 +0100 |
commit | 3613a0df40539e3c883b618cb7259631f9f90901 (patch) | |
tree | aade06dd30d8a3da6286ff6a087e754904f8bb4c | |
parent | 58226980a64e074b91dc562ac50f307b88581c74 (diff) | |
download | ffmpeg-3613a0df40539e3c883b618cb7259631f9f90901.tar.gz |
avcodec/apedec: Fix integer overflow in filter_3800()
Fixes: signed integer overflow: 2117181180 + 60483298 cannot be represented in type 'int'
Fixes: 18344/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5685327791915008
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 1c038c5c63375883a8a94332cffd701c4cb1301a)
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 315bd162d5..0c0c22b18a 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -881,7 +881,7 @@ static av_always_inline int filter_3800(APEPredictor *p, p->coeffsB[filter][1] -= (((d4 >> 30) & 2) - 1) * sign; p->filterB[filter] = p->lastA[filter] + (predictionB >> shift); - p->filterA[filter] = p->filterB[filter] + ((int)(p->filterA[filter] * 31U) >> 5); + p->filterA[filter] = p->filterB[filter] + (unsigned)((int)(p->filterA[filter] * 31U) >> 5); return p->filterA[filter]; } |