summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2020-10-08 20:44:23 +0200
committerMichael Niedermayer <[email protected]>2021-02-02 14:18:21 +0100
commit9b6d73a9ae9c4b1ce0b44957fca90ab3b2d1041b (patch)
tree604d44dc2ff71e099fe1c8aa0aedb621005e9ac0
parenta3493e100dd3eadff0f668d16991d35f459b5a15 (diff)
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 <[email protected]> (cherry picked from commit 33624f4f2e1feb08f277126e637d4a28016eb07a) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/flvdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 957acedf39..5d0e5accdb 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -495,6 +495,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) {