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>
This commit is contained in:
parent
2be3007ed5
commit
c1ed78a591
1 changed files with 1 additions and 1 deletions
|
@ -3041,7 +3041,7 @@ static void compute_chapters_end(AVFormatContext *s)
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
int64_t max_time = 0;
|
int64_t max_time = 0;
|
||||||
|
|
||||||
if (s->duration > 0)
|
if (s->duration > 0 && s->start_time < INT64_MAX - s->duration)
|
||||||
max_time = s->duration +
|
max_time = s->duration +
|
||||||
((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);
|
((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue