Commit 7686ba1f authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/alac: Fix integer overflow in lpc_prediction() with sign

Fixes: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int'
Fixes: 18643/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5672182449700864

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 589cb444
...@@ -227,7 +227,7 @@ static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out, ...@@ -227,7 +227,7 @@ static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out,
val = d - pred[j]; val = d - pred[j];
sign = sign_only(val) * error_sign; sign = sign_only(val) * error_sign;
lpc_coefs[j] -= sign; lpc_coefs[j] -= sign;
val *= sign; val *= (unsigned)sign;
error_val -= (val >> lpc_quant) * (j + 1); error_val -= (val >> lpc_quant) * (j + 1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment