aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-19 23:27:21 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-07-06 23:06:23 +0200
commit99745dc2f353be1eb97291bd501053709b7b2d61 (patch)
tree32669dd5f6c4fb48a10bea1d6356d255930746a9 /libavcodec/alsdec.c
parentdcef55b5ff8e36d30100df956102ce190b835840 (diff)
downloadffmpeg-99745dc2f353be1eb97291bd501053709b7b2d61.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>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index e54440910c..420bcf835a 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1033,7 +1033,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;
}