aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-11-08 20:40:46 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit14c3ac2e04820e3a64adcb2cc8c04b81f7a54b31 (patch)
treecf340e85499030a90f62374ef9c3180261ee5e4e
parentc0727c6dd1076994285433639cb55abeeae716a6 (diff)
downloadffmpeg-14c3ac2e04820e3a64adcb2cc8c04b81f7a54b31.tar.gz
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/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 7686ba1f149a94c3bac235589de8aa8db92be4e5) 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 f90252b7fa..54b9190eff 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -226,7 +226,7 @@ static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out,
val = d - pred[j];
sign = sign_only(val) * error_sign;
lpc_coefs[j] -= sign;
- val *= sign;
+ val *= (unsigned)sign;
error_val -= (val >> lpc_quant) * (j + 1);
}
}