diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-25 11:12:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-06 20:30:58 +0100 |
commit | c8f306fc0b9af83dace35e13a3e266397ba27cb4 (patch) | |
tree | 1fac519e3c887f9850898103a6ed43402e974e29 | |
parent | e53182c467ef3df7ababc45af32dfb86ee5a67f1 (diff) | |
download | ffmpeg-c8f306fc0b9af83dace35e13a3e266397ba27cb4.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 cee26b5415..e7cf2210ed 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -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) |