summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-23 04:33:05 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-23 04:33:05 +0200
commit220df143b962dd8ed65cee90bcff8565a28ee0e6 (patch)
tree4da5a2f48db5a5c31d0abfb339af2f4ecac5a6cf
parent744df0a0319c82cf0da8fdb167255516853f1238 (diff)
downloadffmpeg-streaming-220df143b962dd8ed65cee90bcff8565a28ee0e6.zip
ffmpeg-streaming-220df143b962dd8ed65cee90bcff8565a28ee0e6.tar.gz
avformat/utils: Check end time in avpriv_new_chapter()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8e79177..7e3ec9b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3789,6 +3789,11 @@ AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base,
AVChapter *chapter = NULL;
int i;
+ if (end != AV_NOPTS_VALUE && start > end) {
+ av_log(s, AV_LOG_ERROR, "Chapter end time %"PRId64" before start %"PRId64"\n", end, start);
+ return NULL;
+ }
+
for (i = 0; i < s->nb_chapters; i++)
if (s->chapters[i]->id == id)
chapter = s->chapters[i];
OpenPOWER on IntegriCloud