Commit c4c02456 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent df640dbb
...@@ -695,13 +695,13 @@ static int estimate_sid_gain(G723_1_Context *p) ...@@ -695,13 +695,13 @@ static int estimate_sid_gain(G723_1_Context *p)
if (y <= 0) { if (y <= 0) {
t = seg * 32 + (val + 1 << seg2); t = seg * 32 + (val + 1 << seg2);
t = t * t - x; t = t * t - x;
val = (seg2 - 1 << 4) + val; val = (seg2 - 1) * 16 + val;
if (t >= y) if (t >= y)
val++; val++;
} else { } else {
t = seg * 32 + (val - 1 << seg2); t = seg * 32 + (val - 1 << seg2);
t = t * t - x; t = t * t - x;
val = (seg2 - 1 << 4) + val; val = (seg2 - 1) * 16 + val;
if (t >= y) if (t >= y)
val--; val--;
} }
......
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