diff mbox

[FFmpeg-devel] lavf/utils: Do not force the chapter end time before chapter start

Message ID CAB0OVGoZFOY=sEWbuw5LFoGvEy7ESy0FhK1YYObPPzv99fh02Q@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Sept. 17, 2017, 9:38 p.m. UTC
Hi!

Attached patch fixes ticket #6671.

Please comment, Carl Eugen

Comments

Carl Eugen Hoyos Sept. 19, 2017, 11:02 p.m. UTC | #1
2017-09-17 23:38 GMT+02:00 Carl Eugen Hoyos <ceffmpeg@gmail.com>:
> Hi!
>
> Attached patch fixes ticket #6671.

Patch applied.

Carl Eugen
diff mbox

Patch

From 87d7914d0f60c26ac89fde3cf2a21c6c95c64b0f Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
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 23865c8..7abca63 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;
         }
 }
 
-- 
1.7.10.4