PR #21729 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21729
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21729.patch

Fixes: Timeout
Fixes: 
477315122/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5274792315125760

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>


>From 0eb83a4d5a8a70a2322f649aea31b8132ab54edf Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Tue, 10 Feb 2026 22:46:58 +0100
Subject: [PATCH] avformat/cafdec: Check nb_entries in read_info_chunk()

Fixes: Timeout
Fixes: 
477315122/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5274792315125760

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/cafdec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 656b473140..1557391ef3 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -326,6 +326,10 @@ static void read_info_chunk(AVFormatContext *s, int64_t 
size)
     AVIOContext *pb = s->pb;
     unsigned int i;
     unsigned int nb_entries = avio_rb32(pb);
+
+    if (3LL * nb_entries > size)
+        return;
+
     for (i = 0; i < nb_entries && !avio_feof(pb); i++) {
         char key[32];
         char value[1024];
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to