aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-01 00:16:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-06 20:30:57 +0100
commit50947f65e0adb5a62bcdf8ce03a6d779635a2052 (patch)
tree7e40e60962eba28de8b8e852aa7bf416ac483499
parent684fbde543473c9c6bb189052e5a6b948a7c23f5 (diff)
downloadffmpeg-50947f65e0adb5a62bcdf8ce03a6d779635a2052.tar.gz
avcodec/alac: Fix integer overflow in LPC
Fixes: signed integer overflow: 2147483628 + 128 cannot be represented in type 'int' Fixes: 17783/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5146470595952640 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 44b73a0568f8ad5993ec79b29873151f316bf95c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/alac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 0ba4b8fd84..1a6ab56f90 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -211,7 +211,7 @@ static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out,
/* LPC prediction */
for (j = 0; j < lpc_order; j++)
val += (pred[j] - d) * lpc_coefs[j];
- val = (val + (1 << (lpc_quant - 1))) >> lpc_quant;
+ val = (val + (1LL << (lpc_quant - 1))) >> lpc_quant;
val += d + error_val;
buffer_out[i] = sign_extend(val, bps);