Skip to content
Snippets Groups Projects
Commit 16372498 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/sonic: Use unsigned for predictor_k to avoid undefined behavior

Fixes: signed integer overflow: -1094995529 * 24 cannot be represented in type 'int'
Fixes: 44436/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-4874459459223552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg


Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 28008bf9)
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 478796dc
No related branches found
No related tags found
No related merge requests found
...@@ -1018,7 +1018,7 @@ static int sonic_decode_frame(AVCodecContext *avctx, ...@@ -1018,7 +1018,7 @@ static int sonic_decode_frame(AVCodecContext *avctx,
// dequantize // dequantize
for (i = 0; i < s->num_taps; i++) for (i = 0; i < s->num_taps; i++)
s->predictor_k[i] *= s->tap_quant[i]; s->predictor_k[i] *= (unsigned) s->tap_quant[i];
if (s->lossless) if (s->lossless)
quant = 1; quant = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment