diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-25 12:12:02 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-09 20:03:37 +0300 |
commit | 7786f6c30e77a393b72ded01baa4250738925509 (patch) | |
tree | b459dada12258c896c3286553b9dd7be7f8a6a28 /libavcodec/adpcm.c | |
parent | 1c63edcdd208bf18a3be66e94deb6ac115f6364e (diff) |
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>
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r-- | libavcodec/adpcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 53d8d0be6a..edf7052636 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -342,7 +342,7 @@ static inline int16_t adpcm_ima_oki_expand_nibble(ADPCMChannelStatus *c, int nib c->predictor = av_clip_intp2(predictor, 11); c->step_index = step_index; - return c->predictor << 4; + return c->predictor * 16; } static inline int16_t adpcm_ct_expand_nibble(ADPCMChannelStatus *c, int8_t nibble) |