diff mbox series

[FFmpeg-devel,3/4] avformat/flvdec: Check for EOF in amf_skip_tag()

Message ID 20210112215116.21186-3-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/4] avformat/asfdec_o: Check size vs. offset in detect_unknown_subobject()
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Jan. 12, 2021, 9:51 p.m. UTC
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 | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index ad6e7a3ca5..9e348f66b3 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -841,6 +841,9 @@  static int amf_skip_tag(AVIOContext *pb, AMFDataType type)
 {
     int nb = -1, ret, parse_name = 1;
 
+    if (avio_feof(pb))
+        return AVERROR_EOF;
+
     switch (type) {
     case AMF_DATA_TYPE_NUMBER:
         avio_skip(pb, 8);