diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-28 23:51:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-29 00:14:02 +0200 |
commit | 2be3007ed55f1513bcae3d2a076e71878f48eb03 (patch) | |
tree | cc6eb04c7bd86c2db5028b70dfb82bd0049aa5f3 | |
parent | af56d0dffa3e3ff0649703a2a1f7669fe918ba29 (diff) |
avformat/utils: avoid overflow in update_stream_timings() with huge durations
Fixes: usan_granule_overflow
Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 468ba1a2d6..4ccc5f5cfa 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2491,7 +2491,7 @@ static void update_stream_timings(AVFormatContext *ic) end_time1 = av_rescale_q_rnd(st->duration, st->time_base, AV_TIME_BASE_Q, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); - if (end_time1 != AV_NOPTS_VALUE) { + if (end_time1 != AV_NOPTS_VALUE && start_time1 <= INT64_MAX - end_time1) { end_time1 += start_time1; end_time = FFMAX(end_time, end_time1); } |