aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rka.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-02-20 20:09:36 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-02-22 18:01:52 +0100
commita02e45a1f3cc6f07c7437c1e225dea2683f843cf (patch)
tree60fb8d4533ab45ba7474f2aa6de9726b028b8b2a /libavcodec/rka.c
parenta5d4e7e3f981ce90b92a9da7da26a3c2a2e061e9 (diff)
downloadffmpeg-a02e45a1f3cc6f07c7437c1e225dea2683f843cf.tar.gz
avcodec/rka: avoid undefined doubling sum overflow
Fixes: signed integer overflow: -2124073172 * 2 cannot be represented in type 'int' Fixes: 56099/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-4530933127839744 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/rka.c')
-rw-r--r--libavcodec/rka.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/rka.c b/libavcodec/rka.c
index 1eb2289e58..2212e3f930 100644
--- a/libavcodec/rka.c
+++ b/libavcodec/rka.c
@@ -724,7 +724,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns
src = &ctx->buf1[off + -1];
for (int i = 0; i < filt.size && i < 15; i++)
sum += filt.coeffs[i] * (unsigned)src[-i];
- sum = sum * 2;
+ sum = sum * 2U;
for (int i = 15; i < filt.size; i++)
sum += filt.coeffs[i] * (unsigned)src[-i];
sum = sum >> 6;