diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-26 15:37:30 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-15 12:25:45 +0100 |
commit | e80c90eadba45349f89d85a1048cf08e95158c90 (patch) | |
tree | 3450504fab01de7074767419a2f6d72b7305c5c1 /libavcodec | |
parent | fb12d635c5ca96eb5c164d7a0d362ff7cd17247a (diff) | |
download | ffmpeg-e80c90eadba45349f89d85a1048cf08e95158c90.tar.gz |
avcodec/alsdec: Fix integer overflows of raw_samples in decode_var_block_data()
This also makes the code consistent with the existing similar MUL64()
in decode_var_block_data()
Fixes: signed integer overflow: -7277630735906765035 + -3272193951413647896 cannot be represented in type 'long'
Fixes: 16015/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5666552818434048
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 fad3ec89b7a664b93b5e29bdb0db0cab0272a0c4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/alsdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 21282eb459..c9de71f960 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -923,7 +923,7 @@ static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) y = 1 << 6; for (base = begin; base < end; base++, tab++) - y += MUL64(bd->ltp_gain[tab], raw_samples[base]); + y += (uint64_t)MUL64(bd->ltp_gain[tab], raw_samples[base]); raw_samples[ltp_smp] += y >> 7; } @@ -935,7 +935,7 @@ static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) y = 1 << 19; for (sb = 0; sb < smp; sb++) - y += MUL64(lpc_cof[sb], raw_samples[-(sb + 1)]); + y += (uint64_t)MUL64(lpc_cof[sb], raw_samples[-(sb + 1)]); *raw_samples++ -= y >> 20; parcor_to_lpc(smp, quant_cof, lpc_cof); |