1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-19 05:49:09 +02:00

avcodec/adpcm: Fix left shifts in AV_CODEC_ID_ADPCM_EA

Fixes: left shift of negative value -1
Fixes: 17683/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_EA_R2_fuzzer-5111690013704192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8695fbec573b0d434cf2e703a0d45742a09a5d94)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2019-09-27 12:04:57 +02:00
parent 881b3de55a
commit 17e3552008

View File

@ -1294,10 +1294,10 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
for (count2=0; count2<28; count2++) {
if (count2 & 1)
next_sample = sign_extend(byte, 4) << shift;
next_sample = (unsigned)sign_extend(byte, 4) << shift;
else {
byte = bytestream2_get_byte(&gb);
next_sample = sign_extend(byte >> 4, 4) << shift;
next_sample = (unsigned)sign_extend(byte >> 4, 4) << shift;
}
next_sample += (current_sample * coeff1) +