aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-27 12:04:57 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 11:30:43 +0100
commit17e355200834d741f2a778f7aea8dc84eb6b5f6e (patch)
treeed9fee806a3a6b5f49e34c84a90c1584a7e74c96 /libavcodec
parent881b3de55a4424641aa047aca8d6c346f6237e21 (diff)
downloadffmpeg-17e355200834d741f2a778f7aea8dc84eb6b5f6e.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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/adpcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index b0f8c11cb5..9eef7ad2b9 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -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) +