diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-08 20:44:23 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-17 21:34:53 +0200 |
commit | 71a6b3fdd0f5b9a048038190acda99c8128a1add (patch) | |
tree | 81c27b45dd888ccb27ad3ad89c0cd0fdc961146e | |
parent | 58bd3eabfc0a5c7d6f3eee53fc6ace72144abf06 (diff) | |
download | ffmpeg-71a6b3fdd0f5b9a048038190acda99c8128a1add.tar.gz |
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@niedermayer.cc>
(cherry picked from commit 33624f4f2e1feb08f277126e637d4a28016eb07a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/flvdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 36a179722f..7b5ce983a8 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -395,6 +395,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) { |