diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-09-18 17:03:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-01-31 22:56:14 +0100 |
commit | a2d129a841f5f2393196f80df3781ac28607738b (patch) | |
tree | a038e3a07b48a088be2fe54435a7dd6cff09af93 | |
parent | fd0b42344a7a96f9401c4e1682bd9ded413d0607 (diff) | |
download | ffmpeg-a2d129a841f5f2393196f80df3781ac28607738b.tar.gz |
avcodec/svq3: Fix overflow in svq3_add_idct_c()
Fixes: runtime error: signed integer overflow: 2147392585 + 524288 cannot be represented in type 'int'
Fixes: 3348/clusterfuzz-testcase-minimized-4809500517203968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2c933c51687db958d8045d25ed87848342e869f6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/svq3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index e05cab5a04..fdf2e00a91 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -228,7 +228,7 @@ void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, const unsigned z1 = 13 * (block[i + 4 * 0] - block[i + 4 * 2]); const unsigned z2 = 7 * block[i + 4 * 1] - 17 * block[i + 4 * 3]; const unsigned z3 = 17 * block[i + 4 * 1] + 7 * block[i + 4 * 3]; - const int rr = (dc + 0x80000); + const int rr = (dc + 0x80000u); dst[i + stride * 0] = av_clip_uint8(dst[i + stride * 0] + ((int)((z0 + z3) * qmul + rr) >> 20)); dst[i + stride * 1] = av_clip_uint8(dst[i + stride * 1] + ((int)((z1 + z2) * qmul + rr) >> 20)); |