diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-03-28 00:26:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-04-13 23:39:50 +0200 |
commit | 8ed50e18388f3d5470d4a89d99a17439245b3173 (patch) | |
tree | 254b8bd10495f6b0a980c2d82f83eefb60760e1f | |
parent | 7ea021e7bf974256e5b215e3a328855db9d41b5f (diff) | |
download | ffmpeg-8ed50e18388f3d5470d4a89d99a17439245b3173.tar.gz |
avcodec/takdsp: Fix integer overflow in decorrelate_sf()
Fixes: signed integer overflow: -101 * 71041254 cannot be represented in type 'int'
Fixes: 45938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-4687974320701440
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 01d8c887f63bcb1f870034ed441504b3daffc645)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/takdsp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/takdsp.c b/libavcodec/takdsp.c index 9cb8052596..a8f9dba342 100644 --- a/libavcodec/takdsp.c +++ b/libavcodec/takdsp.c @@ -65,7 +65,7 @@ static void decorrelate_sf(int32_t *p1, int32_t *p2, int length, int dshift, int for (i = 0; i < length; i++) { int32_t a = p1[i]; int32_t b = p2[i]; - b = (unsigned)(dfactor * (b >> dshift) + 128 >> 8) << dshift; + b = (unsigned)((int)(dfactor * (unsigned)(b >> dshift) + 128) >> 8) << dshift; p1[i] = b - a; } } |