aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/g723_1dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-27 17:53:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-10-16 19:17:57 +0200
commit07732f12a43ac3048e44c086c9a8c811452ba31c (patch)
tree241325c033afa863e840f907a2ce3bbb14532812 /libavcodec/g723_1dec.c
parent5c072c9ed7c6f173b8a0a886fb7fe1e8e4c1fadd (diff)
downloadffmpeg-07732f12a43ac3048e44c086c9a8c811452ba31c.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>
Diffstat (limited to 'libavcodec/g723_1dec.c')
-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 d1faf92c39..a7bf528470 100644
--- a/libavcodec/g723_1dec.c
+++ b/libavcodec/g723_1dec.c
@@ -678,6 +678,8 @@ static int estimate_sid_gain(G723_1_ChannelContext *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);