Browse Source

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 c4c0245686)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.5
Michael Niedermayer 8 years ago
parent
commit
bec98cd8bd
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/g723_1dec.c

+ 2
- 2
libavcodec/g723_1dec.c View File

@@ -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--;
}


Loading…
Cancel
Save