diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-09-24 13:07:39 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-09-24 21:08:23 +0200 |
commit | 73b644cdee8a45d2fd736f556b6414615d11d970 (patch) | |
tree | 25b06db88c047f85bf283cb8063b594bb5fa6369 /libavformat/utils.c | |
parent | 3512ed3622e1200f03e0d508b5c1bcbf9f5d2c88 (diff) | |
download | ffmpeg-73b644cdee8a45d2fd736f556b6414615d11d970.tar.gz |
lavf/utils: Avoid an overflow for huge negative durations.
Fixes ticket #5135.
(cherry picked from commit 267da70ea8c36caaa645a3c4f1c5f0ca8bae156a)
Diffstat (limited to 'libavformat/utils.c')
-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 fbc9a68bbe..42b617e2c1 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2373,7 +2373,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 && start_time1 <= INT64_MAX - end_time1) { + if (end_time1 != AV_NOPTS_VALUE && (end_time1 > 0 ? start_time1 <= INT64_MAX - end_time1 : start_time1 >= INT64_MIN - end_time1)) { end_time1 += start_time1; end_time = FFMAX(end_time, end_time1); } |