aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-07-20 01:05:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-07-22 17:14:53 +0200
commite8a51675ea8abf67fd5768dcfa17869e130cb8a5 (patch)
tree3df9f08bb3b1577e4b73474144aaff2e6423fda9
parent1c06f776e6ecfc3f17bdd1e29c6add72548c9576 (diff)
downloadffmpeg-e8a51675ea8abf67fd5768dcfa17869e130cb8a5.tar.gz
avformat/mov: Check for EOF in mov_read_iloc()
Fixes: Timeout Fixes: 49216/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6563000529584128 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 744ad45c44e69e354e924902c4daf0044dcd9955) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 29828ea7e6..a644f9ac62 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7540,6 +7540,8 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
for (int i = 0; i < item_count; i++) {
int item_id = (version < 2) ? avio_rb16(pb) : avio_rb32(pb);
+ if (avio_feof(pb))
+ return AVERROR_INVALIDDATA;
if (version > 0)
avio_rb16(pb); // construction_method.
avio_rb16(pb); // data_reference_index.