Message ID | 20221116233220.5183-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 8f975641d7e853bd8e407974db5fba998e6eb5f4 |
Headers | show |
Series | [FFmpeg-devel,1/3] avcodec/bonk: Use unsigned in predictor_init_state() to avoid undefined behavior | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On Thu, Nov 17, 2022 at 12:32:18AM +0100, Michael Niedermayer wrote: > Fixes: signed integer overflow: -5010 * -717450 cannot be represented in type 'int' > Fixes: 53370/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-4945644204195840 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/bonk.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) will apply remaining patches (1+3) of this patchset [...]
diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c index ebe8e46d70..df5a80b06e 100644 --- a/libavcodec/bonk.c +++ b/libavcodec/bonk.c @@ -277,10 +277,10 @@ static int predictor_calc_error(int *k, int *state, int order, int error) return x; } -static void predictor_init_state(int *k, int *state, int order) +static void predictor_init_state(int *k, unsigned *state, int order) { for (int i = order - 2; i >= 0; i--) { - int x = state[i]; + unsigned x = state[i]; for (int j = 0, p = i + 1; p < order; j++, p++) { int tmp = x + shift_down(k[j] * state[p], LATTICE_SHIFT);
Fixes: signed integer overflow: -5010 * -717450 cannot be represented in type 'int' Fixes: 53370/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-4945644204195840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/bonk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)