mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avcodec/vp9dsp_template: Fix integer overflows in itxfm_wrapper
Fixes: signed integer overflow: 2147483641 + 32 cannot be represented in type 'int' Fixes: 27452/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-5078752576667648 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
3d7ee5c91a
commit
4dfb7ff528
@ -1138,7 +1138,7 @@ static void type_a##_##type_b##_##sz##x##sz##_add_c(uint8_t *_dst, \
|
||||
for (j = 0; j < sz; j++) \
|
||||
dst[j * stride] = av_clip_pixel(dst[j * stride] + \
|
||||
(bits ? \
|
||||
(t + (1 << (bits - 1))) >> bits : \
|
||||
(int)(t + (1U << (bits - 1))) >> bits : \
|
||||
t)); \
|
||||
dst++; \
|
||||
} \
|
||||
@ -1153,7 +1153,7 @@ static void type_a##_##type_b##_##sz##x##sz##_add_c(uint8_t *_dst, \
|
||||
for (j = 0; j < sz; j++) \
|
||||
dst[j * stride] = av_clip_pixel(dst[j * stride] + \
|
||||
(bits ? \
|
||||
(out[j] + (1 << (bits - 1))) >> bits : \
|
||||
(int)(out[j] + (1U << (bits - 1))) >> bits : \
|
||||
out[j])); \
|
||||
dst++; \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user