[FFmpeg-cvslog] avcodec/rka: avoid negative value shift
Michael Niedermayer
git at videolan.org
Sun Feb 26 15:17:02 EET 2023
ffmpeg | branch: release/6.0 | Michael Niedermayer <michael at niedermayer.cc> | Mon Feb 20 20:04:18 2023 +0100| [8a6c037acd0b163ca737015e28164126d276b704] | committer: Michael Niedermayer
avcodec/rka: avoid negative value shift
Fixes: left shift of negative value -81
Fixes: 56061/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-4649758062149632
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit a5d4e7e3f981ce90b92a9da7da26a3c2a2e061e9)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a6c037acd0b163ca737015e28164126d276b704
---
libavcodec/rka.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/rka.c b/libavcodec/rka.c
index 7452acf27f..1eb2289e58 100644
--- a/libavcodec/rka.c
+++ b/libavcodec/rka.c
@@ -737,7 +737,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns
}
ctx->buf0[off] = ctx->buf1[off] + ctx->buf0[off + -1];
} else {
- val <<= ctx->cmode;
+ val *= 1 << ctx->cmode;
sum += ctx->buf0[off + -1] + val;
switch (s->bps) {
case 16: sum = av_clip_int16(sum); break;
More information about the ffmpeg-cvslog
mailing list