[FFmpeg-cvslog] avformat/flvdec: Check for EOF in amf_parse_object()

Michael Niedermayer git at videolan.org
Sat Oct 17 15:41:04 EEST 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Oct  8 20:44:23 2020 +0200| [33624f4f2e1feb08f277126e637d4a28016eb07a] | committer: Michael Niedermayer

avformat/flvdec: Check for EOF in amf_parse_object()

Fixes: Timeout (too long -> 1ms)
Fixes: 26108/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5653887668977664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33624f4f2e1feb08f277126e637d4a28016eb07a
---

 libavformat/flvdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index d480d0bc67..ac9f9c77db 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -495,6 +495,8 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
 
     num_val  = 0;
     ioc      = s->pb;
+    if (avio_feof(ioc))
+        return AVERROR_EOF;
     amf_type = avio_r8(ioc);
 
     switch (amf_type) {



More information about the ffmpeg-cvslog mailing list