aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rka.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-05-25 22:58:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-06-18 14:29:11 +0200
commit1ee303f1e1677fd997da05ae1cc6aca064f96bdb (patch)
treefeae9c348e38ba4219d4f48b813ab3e6620613f3 /libavcodec/rka.c
parentfead656a7bf523d448fe8bd39c1f2ea36be98fb9 (diff)
downloadffmpeg-1ee303f1e1677fd997da05ae1cc6aca064f96bdb.tar.gz
avcodec/rka: Avoid undefined left shift
Fixes: left shift of 34136248 by 6 places cannot be represented in type 'int' Fixes: 58429/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-5692211592560640 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 e0ed8c16e4..76dca52602 100644
--- a/libavcodec/rka.c
+++ b/libavcodec/rka.c
@@ -750,7 +750,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns
}
if (ctx->cmode2 != 0) {
int sum = 0;
- for (int i = (m << 6) / split; i > 0; i = i >> 1)
+ for (int i = (signed)((unsigned)m << 6) / split; i > 0; i = i >> 1)
sum++;
sum = sum - (ctx->cmode2 + 7);
ctx->cmode = FFMAX(sum, tab[ctx->cmode2]);