aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-25 11:12:02 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit3db973db96e68ae062820d839e30e5cdf330a8a1 (patch)
treec8d1ae8ae1b101ce928f7cd49168e2fc7054ac26
parent31ded792d4949e8beee7ffed48318e6fabd8386a (diff)
downloadffmpeg-3db973db96e68ae062820d839e30e5cdf330a8a1.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 4a580092bc..acac82496b 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -293,7 +293,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)