aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-05-10 11:08:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 13:33:44 +0200
commit3ee001de6f71a66f52d539022a5d9b5b2ca2f735 (patch)
treeca052ac8be5ffa02326a2da71dbcfdc089538ec2 /libavcodec
parent033ecda2f2b894ec499f99f34c0396841f2579d9 (diff)
downloadffmpeg-3ee001de6f71a66f52d539022a5d9b5b2ca2f735.tar.gz
avcodec/alac: Fix integer overflow with 24/20bps samples
Fixes: signed integer overflow: 1020048 * 4096 cannot be represented in type 'int' Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5753877751660544 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 22e51e95ac97864b3d7b21124eaf8fcce147f61e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/alac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index cf0f4fc147..bb0619a2d0 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -397,13 +397,13 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
case 20: {
for (ch = 0; ch < channels; ch++) {
for (i = 0; i < alac->nb_samples; i++)
- alac->output_samples_buffer[ch][i] *= 1 << 12;
+ alac->output_samples_buffer[ch][i] *= 1U << 12;
}}
break;
case 24: {
for (ch = 0; ch < channels; ch++) {
for (i = 0; i < alac->nb_samples; i++)
- alac->output_samples_buffer[ch][i] *= 1 << 8;
+ alac->output_samples_buffer[ch][i] *= 1U << 8;
}}
break;
}