Commit 64ac8a6e authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/apedec: Fix integer overflow in filter_fast_3320()

Fixes: signed integer overflow: -1094994793 * 2 cannot be represented in type 'int'
Fixes: 16139/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5663911036059648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6b57a294
......@@ -828,7 +828,7 @@ static av_always_inline int filter_fast_3320(APEPredictor *p,
return decoded;
}
predictionA = p->buf[delayA] * 2 - p->buf[delayA - 1];
predictionA = p->buf[delayA] * 2U - p->buf[delayA - 1];
p->lastA[filter] = decoded + ((int32_t)(predictionA * p->coeffsA[filter][0]) >> 9);
if ((decoded ^ predictionA) > 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment