diff --git a/libavformat/mov.c b/libavformat/mov.c index f5a4ee06f2..fa0471add6 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3233,7 +3233,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (atom.size < 0) atom.size = INT64_MAX; - while (total_size + 8 <= atom.size && !avio_feof(pb)) { + while (total_size <= atom.size - 8 && !avio_feof(pb)) { int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL; a.size = atom.size; a.type=0;