You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
lavf/utils: Avoid an overflow for huge negative durations.
Fixes ticket #5135.
This commit is contained in:
@@ -2547,7 +2547,7 @@ static void update_stream_timings(AVFormatContext *ic)
|
|||||||
end_time1 = av_rescale_q_rnd(st->duration, st->time_base,
|
end_time1 = av_rescale_q_rnd(st->duration, st->time_base,
|
||||||
AV_TIME_BASE_Q,
|
AV_TIME_BASE_Q,
|
||||||
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
|
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_time1 += start_time1;
|
||||||
end_time = FFMAX(end_time, end_time1);
|
end_time = FFMAX(end_time, end_time1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user