[FFmpeg-devel] [PATCH 3/3] avformat/flvdec: Check for EOF in amf_parse_object()
Michael Niedermayer
michael at niedermayer.cc
Thu Oct 8 22:19:15 EEST 2020
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>
---
libavformat/flvdec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index d480d0bc67..e6786e8b38 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -493,8 +493,11 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
double num_val;
amf_date date;
+
num_val = 0;
ioc = s->pb;
+ if (avio_feof(ioc))
+ return AVERROR_EOF;
amf_type = avio_r8(ioc);
switch (amf_type) {
--
2.17.1
More information about the ffmpeg-devel
mailing list