aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-03-01 22:46:34 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-03 12:10:23 +0200
commit8640db14e70fa7f52397dbb6e54a62e5e1f0d2c2 (patch)
treeeded61f4a18e4ca05dc69dfa0889d95b5dfd6f81 /libavcodec
parentb66f444683206ca318572c3da5bc017d1b780cb1 (diff)
downloadffmpeg-8640db14e70fa7f52397dbb6e54a62e5e1f0d2c2.tar.gz
avcodec/adpcm: Fix invalid shift in AV_CODEC_ID_ADPCM_PSX
Fixes: left shift of negative value -1 Fixes: 20859/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5720391507247104 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 0a11ef68f0a85905e704e503b433f5aa645d59ac) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/adpcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index f7995d7bac..0cd4dc5b54 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -1674,7 +1674,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
scale = sign_extend(byte, 4);
}
- scale = scale << 12;
+ scale = scale * (1 << 12);
sample = (int)((scale >> shift) + (c->status[channel].sample1 * xa_adpcm_table[filter][0] + c->status[channel].sample2 * xa_adpcm_table[filter][1]) / 64);
}
*samples++ = av_clip_int16(sample);