diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-21 23:41:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-06 20:30:58 +0100 |
commit | e710fd6a838c5af0b04ab55b890976eeab828cb7 (patch) | |
tree | 8ec4af20f72539a2345a373b7a4d70dc99031537 /libavcodec | |
parent | fbc6717495d9585aa41a2db77c4343cc3da3035b (diff) | |
download | ffmpeg-e710fd6a838c5af0b04ab55b890976eeab828cb7.tar.gz |
avcodec/sonic: Fix integer overflow in predictor_calc_error()
Fixes: signed integer overflow: 5 * -1094995529 cannot be represented in type 'int'
Fixes: 18346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5709623893426176
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 c8c17b8cef77dc052e8845e5fd86daf2983fd7dd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/sonic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index 2e3ca79fdd..953c70fcd4 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -473,7 +473,7 @@ static int predictor_calc_error(int *k, int *state, int order, int error) { int k_value = *k_ptr, state_value = *state_ptr; x -= shift_down(k_value * state_value, LATTICE_SHIFT); - state_ptr[1] = state_value + shift_down(k_value * x, LATTICE_SHIFT); + state_ptr[1] = state_value + shift_down(k_value * (unsigned)x, LATTICE_SHIFT); } #else for (i = order-2; i >= 0; i--) |