aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-08 20:44:23 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:37:21 +0200
commit13de14d44da9d224152620b39040dbf01cb94f86 (patch)
tree77f5485d73ccffd349be13fb34ba49469b70c07e
parent29dade5fea9d207112fccc089085fd5db7cff8d7 (diff)
downloadffmpeg-13de14d44da9d224152620b39040dbf01cb94f86.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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index a2dea464e3..0dd14e1c39 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -469,6 +469,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) {