diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-06 10:36:43 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-06 20:30:57 +0100 |
commit | 2f095670c88d290bad0ced63ae1e301ff65acb2f (patch) | |
tree | 53e6eb77140a1aba3f995cbce74e85212b6278dc | |
parent | 40d3103d36e40a34a6cf0197cfd047dfe6221376 (diff) | |
download | ffmpeg-2f095670c88d290bad0ced63ae1e301ff65acb2f.tar.gz |
avcodec/alac: fix undefined behavior with INT_MIN in lpc_prediction()
Fixes: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int'
Fixes: 16786/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5632818851348480
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 0831cbfe099192098d91e049ed9cf03c5a9cb376)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/alac.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 3fbf33c1cf..0ba4b8fd84 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -218,7 +218,7 @@ static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out, /* adapt LPC coefficients */ error_sign = sign_only(error_val); if (error_sign) { - for (j = 0; j < lpc_order && (int)error_val * error_sign > 0; j++) { + for (j = 0; j < lpc_order && (int)(error_val * error_sign) > 0; j++) { int sign; val = d - pred[j]; sign = sign_only(val) * error_sign; |