mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
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 44b73a0568
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
5d4036d0b2
commit
cac656331e
@ -215,7 +215,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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user