aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/flvdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-12 21:54:31 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:53:29 +0200
commitdcd5b364fb8e4f26caa2cd53e7c8df15b13867d1 (patch)
tree86e1c7808f275d634bee549b4c4c7aa7f1a8b844 /libavformat/flvdec.c
parent67dff50ad857c8b888e311cc6ca7f1e95a350be3 (diff)
downloadffmpeg-dcd5b364fb8e4f26caa2cd53e7c8df15b13867d1.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>
Diffstat (limited to 'libavformat/flvdec.c')
-rw-r--r--libavformat/flvdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 9a2cf01271..7eb85dde96 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -814,6 +814,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);