From 2f3a3a7e3270d9c4486fc4d1ed708c2f54338f9c Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sun, 17 Sep 2017 23:34:58 +0200 Subject: [PATCH] lavf/utils: Do not force chapter end time before chapter start. Fixes ticket #6671. --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 23865c88c4..7abca632b5 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3167,7 +3167,7 @@ static void compute_chapters_end(AVFormatContext *s) if (j != i && next_start > ch->start && next_start < end) end = next_start; } - ch->end = (end == INT64_MAX) ? ch->start : end; + ch->end = (end == INT64_MAX || end < ch->start) ? ch->start : end; } }