aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-27 17:53:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-15 12:25:46 +0100
commit888df4b68ce6fd4c920509588000a634ff900f88 (patch)
tree23f9a9d1d58e1c4f3630237521b2fa123d80adf1
parent0041d3cebab4f28a4c80a7be01889c3ccdc9874c (diff)
downloadffmpeg-888df4b68ce6fd4c920509588000a634ff900f88.tar.gz
avcodec/g723_1dec: Fix overflow in shift
Fixes: shift exponent 1008 is too large for 32-bit type 'int' Fixes: 17700/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G723_1_fuzzer-5707633436131328 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 07732f12a43ac3048e44c086c9a8c811452ba31c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/g723_1dec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c
index ab952ec66d..f92eb76ba0 100644
--- a/libavcodec/g723_1dec.c
+++ b/libavcodec/g723_1dec.c
@@ -668,6 +668,8 @@ static int estimate_sid_gain(G723_1_Context *p)
else t = INT32_MAX;
} else
t = p->sid_gain << shift;
+ } else if(shift < -31) {
+ t = (p->sid_gain < 0) ? -1 : 0;
}else
t = p->sid_gain >> -shift;
x = av_clipl_int32(t * (int64_t)cng_filt[0] >> 16);