diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-05-02 01:09:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-06-04 18:21:24 +0200 |
commit | b168aeb734069b09ab174666169f9c5dd631fb1b (patch) | |
tree | 4b87e6bbd81283265ace0e51e350ace342cd88d2 /libavcodec/rka.c | |
parent | cbe5e480aa1679c1dfc20d433e310acd7449af07 (diff) | |
download | ffmpeg-b168aeb734069b09ab174666169f9c5dd631fb1b.tar.gz |
avcodec/rka: avoid undefined multiply in cmode==0
Fixes: signed integer overflow: -182838 * 32768 cannot be represented in type 'int'
Fixes: 58179/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-5333265899978752
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/rka.c b/libavcodec/rka.c index ce39a902af..e0ed8c16e4 100644 --- a/libavcodec/rka.c +++ b/libavcodec/rka.c @@ -732,7 +732,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns if (bits == 0) { ctx->buf1[off] = sum + val; } else { - ctx->buf1[off] = (val + (sum >> bits)) * (1 << bits) + + ctx->buf1[off] = (val + (sum >> bits)) * (1U << bits) + (((1U << bits) - 1U) & ctx->buf1[off + -1]); } ctx->buf0[off] = ctx->buf1[off] + ctx->buf0[off + -1]; |