diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-01-31 16:19:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-10 16:04:26 +0200 |
commit | 2b79229316d2804ef8d4d98ece0a8c3870a51b3b (patch) | |
tree | c478e1e87c741c26c7c6b407e2c8c96b70529833 | |
parent | b290a54e5fd36cd3a43b89110c51c6f40de6b16c (diff) | |
download | ffmpeg-2b79229316d2804ef8d4d98ece0a8c3870a51b3b.tar.gz |
avformat/mvdec: Check for EOF in read_index()
Fixes: Timeout
Fixes: 29550/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5094307193290752
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 6c64351bb1f4dc148069a37754b746fcd4c784cf)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mvdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c index e2e6e66f1f..2b7058560d 100644 --- a/libavformat/mvdec.c +++ b/libavformat/mvdec.c @@ -267,6 +267,8 @@ static void read_index(AVIOContext *pb, AVStream *st) uint32_t pos = avio_rb32(pb); uint32_t size = avio_rb32(pb); avio_skip(pb, 8); + if (avio_feof(pb)) + return ; av_add_index_entry(st, pos, timestamp, size, 0, AVINDEX_KEYFRAME); if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { timestamp += size / (st->codecpar->channels * 2LL); |