Commit 2e8020c6 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '9f25a109'

* commit '9f25a109':
  matroskaenc: Also validate chapter end time
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents d898482a 9f25a109
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment