aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/g723_1dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-12 13:13:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 12:20:16 +0200
commitbec98cd8bd9626657f03e117858e0e270db7d4e7 (patch)
treeb54d70c6162beb0d6533b8bcd4acbc4a8815f45d /libavcodec/g723_1dec.c
parent2964778d7ea8514ada3badd1afb7432b69cff346 (diff)
downloadffmpeg-bec98cd8bd9626657f03e117858e0e270db7d4e7.tar.gz
avcodec/g723_1dec: Fix runtime error: left shift of negative value -1
Fixes: 1504/clusterfuzz-testcase-minimized-6249212138225664 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c4c0245686bc2fcc545644101c7b328fed71f268) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/g723_1dec.c')
-rw-r--r--libavcodec/g723_1dec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c
index 6d452df189..89089f5f64 100644
--- a/libavcodec/g723_1dec.c
+++ b/libavcodec/g723_1dec.c
@@ -695,13 +695,13 @@ static int estimate_sid_gain(G723_1_Context *p)
if (y <= 0) {
t = seg * 32 + (val + 1 << seg2);
t = t * t - x;
- val = (seg2 - 1 << 4) + val;
+ val = (seg2 - 1) * 16 + val;
if (t >= y)
val++;
} else {
t = seg * 32 + (val - 1 << seg2);
t = t * t - x;
- val = (seg2 - 1 << 4) + val;
+ val = (seg2 - 1) * 16 + val;
if (t >= y)
val--;
}