diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-25 11:12:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-31 19:51:56 +0100 |
commit | 88d97044cb5ae839b72641ad3205f4cd46b05a9a (patch) | |
tree | 6d09fcd1baa219bd2dba37f114c7e7c4f0e87462 | |
parent | 9cf2764389acd24c4b6411ffb886af4f9589f87c (diff) | |
download | ffmpeg-88d97044cb5ae839b72641ad3205f4cd46b05a9a.tar.gz |
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 7786f6c30e77a393b72ded01baa4250738925509)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-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 5ed7aa0836..25db285213 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -337,7 +337,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) |