You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
avcodec/g723_1dec: fix invalid shift with negative sid_gain
Fixes: left shift of negative value -1
Fixes: 18395/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G723_1_fuzzer-5710313034350592
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1850c3feaa
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -667,7 +667,7 @@ static int estimate_sid_gain(G723_1_Context *p)
|
|||||||
if (p->sid_gain < 0) t = INT32_MIN;
|
if (p->sid_gain < 0) t = INT32_MIN;
|
||||||
else t = INT32_MAX;
|
else t = INT32_MAX;
|
||||||
} else
|
} else
|
||||||
t = p->sid_gain << shift;
|
t = p->sid_gain * (1 << shift);
|
||||||
} else if(shift < -31) {
|
} else if(shift < -31) {
|
||||||
t = (p->sid_gain < 0) ? -1 : 0;
|
t = (p->sid_gain < 0) ? -1 : 0;
|
||||||
}else
|
}else
|
||||||
|
Reference in New Issue
Block a user