diff mbox series

[FFmpeg-devel,4/4] avformat/id3v2: read_uslt() check for the amount read

Message ID 20240320025923.3794-4-michael@niedermayer.cc
State Accepted
Commit c0f4abe2aa0117a10fb651f2c1c030d4cd516081
Headers show
Series [FFmpeg-devel,1/4] avcodec/jpeg2000htdec: Check M_b / magp before using it in a shift | 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 March 20, 2024, 2:59 a.m. UTC
Fixes: timeout
Fixes: 66783/clusterfuzz-testcase-minimized-ffmpeg_dem_GENH_fuzzer-5356884892647424

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

Patch

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index d83716dcf4..e0a7e3f3ea 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -370,7 +370,7 @@  static void read_uslt(AVFormatContext *s, AVIOContext *pb, int taglen,
     int encoding;
     int ok = 0;
 
-    if (taglen < 1)
+    if (taglen < 4)
         goto error;
 
     encoding = avio_r8(pb);