avformat/matroskaenc: Use the correct data type for the chapter times
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Feb 2015 19:40:00 +0000 (20:40 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Feb 2015 19:40:00 +0000 (20:40 +0100)
Fixes potential integer overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/matroskaenc.c

index 80f7d7f..0051b9f 100644 (file)
@@ -1074,8 +1074,8 @@ 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);
+        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)
             return AVERROR_INVALIDDATA;