[FFmpeg-cvslog] avformat/matroskaenc: Use the correct data type for the chapter times

Michael Niedermayer git at videolan.org
Tue Feb 17 20:47:42 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Feb 17 20:40:00 2015 +0100| [a4cd057bc7ddd2dd094d2ae7b0d6843ade95a626] | committer: Michael Niedermayer

avformat/matroskaenc: Use the correct data type for the chapter times

Fixes potential integer overflow

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a4cd057bc7ddd2dd094d2ae7b0d6843ade95a626
---

 libavformat/matroskaenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 80f7d7f..0051b9f 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -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;



More information about the ffmpeg-cvslog mailing list