diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 71deaf0aa6..882fde13f4 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -1033,7 +1033,7 @@ static int read_header(AVFormatContext *s) while (1) { uint64_t frame_nb = avio_rl64(pb); uint64_t position = avio_rl64(pb); - while (frame_nb > e->size && e <= e_end) { + while (e <= e_end && frame_nb > e->size) { e->pos = last_position; e++; }