mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-16 20:31:32 +00:00
avcodec/ralf: use multiply instead of shift to avoid undefined behavior in decode_block()
Fixes: left shift of negative value -249 Fixes: 18566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5649394561187840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c54b9fc42f
commit
1b7d02642b
@ -408,7 +408,7 @@ static int decode_block(AVCodecContext *avctx, GetBitContext *gb,
|
|||||||
case 4:
|
case 4:
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
t = ch1[i] + ctx->bias[1];
|
t = ch1[i] + ctx->bias[1];
|
||||||
t2 = ((ch0[i] + ctx->bias[0]) << 1) | (t & 1);
|
t2 = ((ch0[i] + ctx->bias[0]) * 2) | (t & 1);
|
||||||
dst0[i] = (t2 + t) / 2;
|
dst0[i] = (t2 + t) / 2;
|
||||||
dst1[i] = (t2 - t) / 2;
|
dst1[i] = (t2 - t) / 2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user