aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-28 23:51:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-05-29 00:25:21 +0200
commitc1ed78a591f68f3c81eded0bfaac313937ffa3b6 (patch)
treed33a58b432cebaf7e086b82a7c61c785e7f27f86 /libavformat
parent2be3007ed55f1513bcae3d2a076e71878f48eb03 (diff)
downloadffmpeg-c1ed78a591f68f3c81eded0bfaac313937ffa3b6.tar.gz
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 4ccc5f5cfa..47f5ba0b11 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);