aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-28 23:51:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-06-05 02:40:31 +0200
commit7f864badc01f92f5861aa57dc954c07977b2f1f4 (patch)
treec44e9bedf1712a547afc7bc31398e8720b164ab2
parentcc1e01d8b67f41659cb03f2500f18fe5df647ff1 (diff)
downloadandroid_external_ffmpeg-7f864badc01f92f5861aa57dc954c07977b2f1f4.tar.gz
android_external_ffmpeg-7f864badc01f92f5861aa57dc954c07977b2f1f4.tar.bz2
android_external_ffmpeg-7f864badc01f92f5861aa57dc954c07977b2f1f4.zip
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> (cherry picked from commit c1ed78a591f68f3c81eded0bfaac313937ffa3b6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index fe684c352d..542ded76cb 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2919,7 +2919,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);