mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
Merge commit '5dc47a2bd52e375ed742c45d08356b45098f458d'
* commit '5dc47a2bd52e375ed742c45d08356b45098f458d': matroskaenc: Validate chapter start and end times Conflicts: libavformat/matroskaenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
d302853bca
@ -1074,14 +1074,16 @@ static int mkv_write_chapters(AVFormatContext *s)
|
||||
for (i = 0; i < s->nb_chapters; i++) {
|
||||
ebml_master chapteratom, chapterdisplay;
|
||||
AVChapter *c = s->chapters[i];
|
||||
int chapterstart = av_rescale_q(c->start, c->time_base, scale);
|
||||
int chapterend = av_rescale_q(c->end, c->time_base, scale);
|
||||
AVDictionaryEntry *t = NULL;
|
||||
if (chapterstart < 0 || 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);
|
||||
put_ebml_uint(pb, MATROSKA_ID_CHAPTERTIMESTART,
|
||||
av_rescale_q(c->start, c->time_base, scale));
|
||||
put_ebml_uint(pb, MATROSKA_ID_CHAPTERTIMEEND,
|
||||
av_rescale_q(c->end, c->time_base, scale));
|
||||
put_ebml_uint(pb, MATROSKA_ID_CHAPTERTIMESTART, chapterstart);
|
||||
put_ebml_uint(pb, MATROSKA_ID_CHAPTERTIMEEND, chapterend);
|
||||
put_ebml_uint(pb, MATROSKA_ID_CHAPTERFLAGHIDDEN , 0);
|
||||
put_ebml_uint(pb, MATROSKA_ID_CHAPTERFLAGENABLED, 1);
|
||||
if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user