summaryrefslogtreecommitdiff
path: root/libavcodec/sbrdsp_fixed.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-11-22 20:18:40 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-11-25 02:32:33 +0100
commit12a511f2c265d6319b7fdc332a6aa8aca1535309 (patch)
tree3f0ee0ab9e458fe8589077ba6e746f26f20bc7e3 /libavcodec/sbrdsp_fixed.c
parent31de45d20b1ff90d4baf7c5a65e88f582efdb2a6 (diff)
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/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/sbrdsp_fixed.c')
-rw-r--r--libavcodec/sbrdsp_fixed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/sbrdsp_fixed.c b/libavcodec/sbrdsp_fixed.c
index a0ef6859f1..57d98da979 100644
--- a/libavcodec/sbrdsp_fixed.c
+++ b/libavcodec/sbrdsp_fixed.c
@@ -133,7 +133,7 @@ static av_always_inline SoftFloat autocorr_calc(int64_t accu)
round = 1U << (nz-1);
mant = (int)((accu + round) >> nz);
- mant = (mant + 0x40)>>7;
+ mant = (mant + 0x40LL)>>7;
mant *= 64;
expo = nz + 15;
return av_int2sf(mant, 30 - expo);