avformat/matroskaenc: Use the correct data type for the chapter times
Fixes potential integer overflow Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -1074,8 +1074,8 @@ static int mkv_write_chapters(AVFormatContext *s)
|
|||||||
for (i = 0; i < s->nb_chapters; i++) {
|
for (i = 0; i < s->nb_chapters; i++) {
|
||||||
ebml_master chapteratom, chapterdisplay;
|
ebml_master chapteratom, chapterdisplay;
|
||||||
AVChapter *c = s->chapters[i];
|
AVChapter *c = s->chapters[i];
|
||||||
int chapterstart = av_rescale_q(c->start, c->time_base, scale);
|
int64_t chapterstart = av_rescale_q(c->start, c->time_base, scale);
|
||||||
int chapterend = av_rescale_q(c->end, c->time_base, scale);
|
int64_t chapterend = av_rescale_q(c->end, c->time_base, scale);
|
||||||
AVDictionaryEntry *t = NULL;
|
AVDictionaryEntry *t = NULL;
|
||||||
if (chapterstart < 0 || chapterstart > chapterend)
|
if (chapterstart < 0 || chapterstart > chapterend)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
Reference in New Issue
Block a user