aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-12-12 00:41:17 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-09 19:37:27 +0100
commit69754e07f5133b20bc789c7dea5d05714f63bf7f (patch)
treee3ca3c3754ee853ef6c535176872812c85f85be7
parent2c8cd4490a6ab2742e6ad1ce059b4f4957b39500 (diff)
downloadffmpeg-69754e07f5133b20bc789c7dea5d05714f63bf7f.tar.gz
avformat/wtvdec: Check for EOF before potentially reseting the eof state
Fixes: infinite loop Fixes: 28042/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6311288967528448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/wtvdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 77908e6392..6c41e3c1a3 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -953,6 +953,9 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
} else
av_log(s, AV_LOG_WARNING, "unsupported chunk:"FF_PRI_GUID"\n", FF_ARG_GUID(g));
+ if (avio_feof(pb))
+ break;
+
avio_skip(pb, WTV_PAD8(len) - consumed);
}
return AVERROR_EOF;