Browse Source

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 8695fbec57)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.2.2
Michael Niedermayer 6 years ago
parent
commit
3f919ef19c
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/adpcm.c

+ 2
- 2
libavcodec/adpcm.c View File

@@ -1351,10 +1351,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) +


Loading…
Cancel
Save