]> git.sesse.net Git - ffmpeg/commitdiff
avformat/flvdec: Check for EOF in amf_skip_tag()
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 12 Jan 2021 20:54:31 +0000 (21:54 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 29 Jan 2021 18:36:46 +0000 (19:36 +0100)
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@niedermayer.cc>
libavformat/flvdec.c

index c1f02125bc40de47458f532051fcc365ae53137a..943c0278e5b94008ac08b405f58783bc706835f5 100644 (file)
@@ -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);