aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-18 22:04:14 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:19 +0200
commitc4b7fbc9810eadf846dcd022a1a9952a35c2527d (patch)
treef55a1775c6be16d8869648dc0bf2db7e64b84866 /libavcodec
parent0abb64d8f33d18243e6e745eaca24455de3dd5fd (diff)
downloadffmpeg-c4b7fbc9810eadf846dcd022a1a9952a35c2527d.tar.gz
avcodec/vp9dsp_template: Fix some overflows in iadst8_1d()
Fixes: signed integer overflow: 190587 * 11585 cannot be represented in type 'int' Fixes: 26407/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-5086348408782848 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 bca0735be52e471b1906aed34c60028d90646d90) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp9dsp_template.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/vp9dsp_template.c b/libavcodec/vp9dsp_template.c
index b047a5270f..76ef0ab7e1 100644
--- a/libavcodec/vp9dsp_template.c
+++ b/libavcodec/vp9dsp_template.c
@@ -1275,10 +1275,10 @@ static av_always_inline void iadst8_1d(const dctcoef *in, ptrdiff_t stride,
t6 = (dctint)((1U << 13) + t4a - t6a) >> 14;
t7 = (dctint)((1U << 13) + t5a - t7a) >> 14;
- out[3] = -(((t2 + t3) * 11585 + (1 << 13)) >> 14);
- out[4] = ((t2 - t3) * 11585 + (1 << 13)) >> 14;
- out[2] = ((t6 + t7) * 11585 + (1 << 13)) >> 14;
- out[5] = -(((t6 - t7) * 11585 + (1 << 13)) >> 14);
+ out[3] = -((dctint)((t2 + t3) * 11585U + (1 << 13)) >> 14);
+ out[4] = (dctint)((t2 - t3) * 11585U + (1 << 13)) >> 14;
+ out[2] = (dctint)((t6 + t7) * 11585U + (1 << 13)) >> 14;
+ out[5] = -((dctint)((t6 - t7) * 11585U + (1 << 13)) >> 14);
}
itxfm_wrap(8, 5)