diff mbox series

[FFmpeg-devel,4/6] avcodec/rka: check for size 1 filter

Message ID 20230220192929.4493-4-michael@niedermayer.cc
State Accepted
Commit 8874cfa2e174cf1a94123fc2f1a3aa4d307a270f
Headers show
Series [FFmpeg-devel,1/6] avformat/mov: Check samplesize and offset to avoid integer overflow | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer Feb. 20, 2023, 7:29 p.m. UTC
Such filters will not advance and be stuck in the current implementation

Fixes: Infinite loop
Fixes: 56052/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RKA_fuzzer-5236218750435328

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/rka.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/rka.c b/libavcodec/rka.c
index 994c563ffd..7452acf27f 100644
--- a/libavcodec/rka.c
+++ b/libavcodec/rka.c
@@ -691,7 +691,7 @@  static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns
     else
         split = size >> 4;
 
-    if (size <= 0)
+    if (size <= 1)
         return 0;
 
     for (int x = 0; x < size;) {