diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-16 00:39:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-16 00:55:07 +0200 |
commit | 4f1d3e02122e1896c2d946ae8c32b8b3f767aa19 (patch) | |
tree | 25df00e6d0286a2f2a0ccdad4c55e2e701ed1685 | |
parent | 13eed267f8c140ca3d69a7a716b917ec7dd77d97 (diff) | |
parent | e740929a071ab032ffa382e89da69c6ec7cf882c (diff) | |
download | ffmpeg-4f1d3e02122e1896c2d946ae8c32b8b3f767aa19.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
lavf: Make sure avg_frame_rate can be calculated without integer overflow
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 070c224ecd..9fd5e6e3e5 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2954,6 +2954,9 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) int best_fps = 0; double best_error = 0.01; + if (st->info->codec_info_duration >= INT64_MAX / st->time_base.num / 2|| + st->info->codec_info_duration_fields >= INT64_MAX / st->time_base.den) + continue; av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, st->info->codec_info_duration_fields*(int64_t)st->time_base.den, st->info->codec_info_duration*2*(int64_t)st->time_base.num, 60000); |