[FFmpeg-cvslog] avformat/utils: avoid overflow in compute_chapters_end() with huge durations

Michael Niedermayer git at videolan.org
Sun May 29 01:00:47 CEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat May 28 23:51:35 2016 +0200| [c1ed78a591f68f3c81eded0bfaac313937ffa3b6] | committer: Michael Niedermayer

avformat/utils: avoid overflow in compute_chapters_end()  with huge durations

Fixes: usan_granule_overflow

Found-by: Thomas Guilbert <tguilbert at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 4ccc5f5..47f5ba0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3041,7 +3041,7 @@ static void compute_chapters_end(AVFormatContext *s)
     unsigned int i, j;
     int64_t max_time = 0;
 
-    if (s->duration > 0)
+    if (s->duration > 0 && s->start_time < INT64_MAX - s->duration)
         max_time = s->duration +
                        ((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);
 



More information about the ffmpeg-cvslog mailing list