aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-19 23:27:21 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-14 23:30:37 +0100
commit49cb2d44a45fceff1c7628ceab99c00b880480b0 (patch)
tree6fb767b8e7367c0a8680247e3c100776c9d37dda
parent1ebd25b1f1fb16e32e0509c2ab4cf92eca1303e1 (diff)
downloadffmpeg-49cb2d44a45fceff1c7628ceab99c00b880480b0.tar.gz
avcodec/alsdec: Fix integer overflow with shifting samples
Fixes: signed integer overflow: -346039050 * 8 cannot be represented in type 'int' Fixes: 15283/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5692700268953600 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 a3bd4b260eb9f0d5817f9b3d672844f127c51a0b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/alsdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 517ea4f16b..73ef25b6c4 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1038,7 +1038,7 @@ static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)
if (*bd->shift_lsbs)
for (smp = 0; smp < bd->block_length; smp++)
- bd->raw_samples[smp] <<= *bd->shift_lsbs;
+ bd->raw_samples[smp] = (unsigned)bd->raw_samples[smp] << *bd->shift_lsbs;
return 0;
}