Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-11-05 22:03:52 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-11-10 23:14:22 +0300
commitf4df49eb483fc49026a8d5578983376347d8e532 (patch)
treec7fab26b571c599d15fdc2521efad95263495567
parent024c5b4ab436b9e035517e4181dc3499e7095290 (diff)
avcodec/bonk: Use unsigned in predictor_calc_error() to avoid undefined overflows
Fixes: signed integer overflow: 22 * -2107998208 cannot be represented in type 'int' Fixes: 51363/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-5660734784143360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/bonk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c
index 409694f710..c3ad80ec73 100644
--- a/libavcodec/bonk.c
+++ b/libavcodec/bonk.c
@@ -273,7 +273,7 @@ static int predictor_calc_error(int *k, int *state, int order, int error)
*state_ptr = &(state[order-2]);
for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--) {
- int k_value = *k_ptr, state_value = *state_ptr;
+ unsigned 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);