diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-20 12:20:06 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-09-22 21:02:52 +0300 |
commit | ce67f442be0f6c4a8794272873852e256b5b8ee4 (patch) | |
tree | 3b742c6189da82157f3efef8bc5256a1474687f0 /libavformat/utils.c | |
parent | bb7bf175951475235ee7d0504198c4a30cf5d5dd (diff) | |
download | ffmpeg-ce67f442be0f6c4a8794272873852e256b5b8ee4.tar.gz |
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>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 22f6d01207..0700c5d07f 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2373,7 +2373,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) double best_error = 0.01; 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; av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, delta_packets*(int64_t)st->time_base.den, |