aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-31 16:19:42 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-17 21:34:53 +0200
commitab5341768c630c7a691027ba80a16a0f2b1da764 (patch)
tree5174babd06093c2236f43171b3b3ff38a03afd0f
parenta076f7897de77e910d87d9408374059352d4fd16 (diff)
downloadffmpeg-ab5341768c630c7a691027ba80a16a0f2b1da764.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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 5fa43c1ac9..3b59f7ee14 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -258,6 +258,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->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
timestamp += size / (st->codec->channels * 2);