Browse Source

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

Fixes: usan_granule_overflow

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.1
Michael Niedermayer 9 years ago
parent
commit
c1ed78a591
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/utils.c

+ 1
- 1
libavformat/utils.c View File

@@ -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);



Loading…
Cancel
Save