aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-12 21:54:31 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:20 +0200
commit2ed03339c3660168dbf06c0ad9b6584b48828995 (patch)
tree27590912e8e9592471e28cd835c6e3045d1a2147
parente537ef1a0d92a2e9d53a4790ae6f56fbb8e438c6 (diff)
downloadffmpeg-2ed03339c3660168dbf06c0ad9b6584b48828995.tar.gz
avformat/flvdec: Check for EOF in amf_skip_tag()
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> (cherry picked from commit 9725d07a1770fbfafe5f7b3f7d95a2a513308538) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/flvdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index f0c8e1fe66..1128ad2b7b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -781,6 +781,9 @@ static int amf_skip_tag(AVIOContext *pb, AMFDataType type, int depth)
if (depth > MAX_DEPTH)
return AVERROR_PATCHWELCOME;
+ if (avio_feof(pb))
+ return AVERROR_EOF;
+
switch (type) {
case AMF_DATA_TYPE_NUMBER:
avio_skip(pb, 8);