diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-09 20:16:07 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-09 20:31:22 +0100 |
commit | 2e8020c66ccb51ca8dab47cd4fcb15f5c0277bbf (patch) | |
tree | 3c3fb586fd4b9cc52f0f497febb46cc41c32e351 | |
parent | d898482ae34fe55a59be5cc0b11a521becb45a43 (diff) | |
parent | 9f25a109922da43c1f81273a431d3b40cb5a785a (diff) | |
download | ffmpeg-2e8020c66ccb51ca8dab47cd4fcb15f5c0277bbf.tar.gz |
Merge commit '9f25a109922da43c1f81273a431d3b40cb5a785a'
* commit '9f25a109922da43c1f81273a431d3b40cb5a785a':
matroskaenc: Also validate chapter end time
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/matroskaenc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 0051b9f509..1c0e3abee8 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1077,8 +1077,11 @@ static int mkv_write_chapters(AVFormatContext *s) int64_t chapterstart = av_rescale_q(c->start, c->time_base, scale); int64_t chapterend = av_rescale_q(c->end, c->time_base, scale); AVDictionaryEntry *t = NULL; - if (chapterstart < 0 || chapterstart > chapterend) + if (chapterstart < 0 || chapterstart > chapterend || chapterend < 0) { + av_log(s, AV_LOG_ERROR, "Invalid chapter start (%"PRId64") or end (%"PRId64").\n", + chapterstart, chapterend); return AVERROR_INVALIDDATA; + } chapteratom = start_ebml_master(pb, MATROSKA_ID_CHAPTERATOM, 0); put_ebml_uint(pb, MATROSKA_ID_CHAPTERUID, c->id + mkv->chapter_id_offset); |