lavf: Avoid setting avg_frame_rate if delta_dts is negative
This avoids setting avg_frame_rate to invalid (negative)
values.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ce67f442be
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:

committed by
Luca Barbato

parent
a6a8f66608
commit
17e7edf75b
@@ -2499,7 +2499,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
|||||||
double best_error = 0.01;
|
double best_error = 0.01;
|
||||||
|
|
||||||
if (delta_dts >= INT64_MAX / st->time_base.num ||
|
if (delta_dts >= INT64_MAX / st->time_base.num ||
|
||||||
delta_packets >= INT64_MAX / st->time_base.den)
|
delta_packets >= INT64_MAX / st->time_base.den ||
|
||||||
|
delta_dts < 0)
|
||||||
continue;
|
continue;
|
||||||
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
|
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
|
||||||
delta_packets*(int64_t)st->time_base.den,
|
delta_packets*(int64_t)st->time_base.den,
|
||||||
|
Reference in New Issue
Block a user