Browse Source

avcodec/adpcm: Fix undefined behavior with negative predictions in IMA OKI

Fixes: left shift of negative value -30
Fixes: 18392/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_OKI_fuzzer-5631771831435264

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 7786f6c30e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n2.8.16
Michael Niedermayer 6 years ago
parent
commit
c8f306fc0b
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/adpcm.c

+ 1
- 1
libavcodec/adpcm.c View File

@@ -277,7 +277,7 @@ static inline short adpcm_ima_oki_expand_nibble(ADPCMChannelStatus *c, int nibbl
c->predictor = av_clip_intp2(predictor, 11);
c->step_index = step_index;

return c->predictor << 4;
return c->predictor * 16;
}

static inline short adpcm_ct_expand_nibble(ADPCMChannelStatus *c, char nibble)


Loading…
Cancel
Save