diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-27 12:04:57 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-06 20:30:57 +0100 |
commit | 68b62e36eb2efc180017b2ab3b1063ed949cbdc7 (patch) | |
tree | 4c98c03dba03a61839c971dd5e29ab18f61a190b | |
parent | 560770d32be84d73823bfd7ae313a1b49030ba86 (diff) | |
download | ffmpeg-68b62e36eb2efc180017b2ab3b1063ed949cbdc7.tar.gz |
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>
-rw-r--r-- | libavcodec/adpcm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 52d0d44cc2..de79a89c4e 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -1213,10 +1213,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) + |