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

Michael Niedermayer git at videolan.org
Fri Jan 29 20:37:38 EET 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Jan 12 21:54:31 2021 +0100| [9725d07a1770fbfafe5f7b3f7d95a2a513308538] | committer: Michael Niedermayer

avformat/flvdec: Check for EOF in amf_skip_tag()

Fixes: Timeout
Fixes: 29070/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5650106766458880

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=9725d07a1770fbfafe5f7b3f7d95a2a513308538
---

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

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index c1f02125bc..943c0278e5 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -854,6 +854,9 @@ static int amf_skip_tag(AVIOContext *pb, AMFDataType type, int depth)
     if (depth > MAX_DEPTH)
         return AVERROR_PATCHWELCOME;
 
+    if (avio_feof(pb))
+        return AVERROR_EOF;
+
     switch (type) {
     case AMF_DATA_TYPE_NUMBER:
         avio_skip(pb, 8);



More information about the ffmpeg-cvslog mailing list