Commit 12a511f2 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/sbrdsp_fixed: Fix integer overflow

Fixes: signed integer overflow: 2147483598 + 64 cannot be represented in type 'int'
Fixes: 4337/clusterfuzz-testcase-minimized-6192658616680448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 31de45d2
...@@ -133,7 +133,7 @@ static av_always_inline SoftFloat autocorr_calc(int64_t accu) ...@@ -133,7 +133,7 @@ static av_always_inline SoftFloat autocorr_calc(int64_t accu)
round = 1U << (nz-1); round = 1U << (nz-1);
mant = (int)((accu + round) >> nz); mant = (int)((accu + round) >> nz);
mant = (mant + 0x40)>>7; mant = (mant + 0x40LL)>>7;
mant *= 64; mant *= 64;
expo = nz + 15; expo = nz + 15;
return av_int2sf(mant, 30 - expo); return av_int2sf(mant, 30 - expo);
......
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