diff --git a/libavformat/mov.c b/libavformat/mov.c index aec9a9d3c4..c85301288c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1379,7 +1379,7 @@ static int mov_read_udta(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) uint32_t tag = get_le32(pb); uint64_t next = url_ftell(pb) + tag_size - 8; - if (next > end) // stop if tag_size is wrong + if (tag_size < 8 || next > end) // stop if tag_size is wrong break; switch (tag) {