lavf/utils: Do not force chapter end time before chapter start.
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>
Sun, 17 Sep 2017 21:34:58 +0000 (23:34 +0200)
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>
Tue, 19 Sep 2017 22:57:29 +0000 (00:57 +0200)
Fixes ticket #6671.

libavformat/utils.c

index 23865c8..7abca63 100644 (file)
@@ -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;
         }
 }