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 c8c17b8cef)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0a4d2b5f67
commit
c2f81cfc78
1 changed files with 1 additions and 1 deletions
|
|
@ -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--)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue