diff --git a/libavformat/utils.c b/libavformat/utils.c index 45a4179552..807d9f10cb 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2782,7 +2782,7 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic) st = ic->streams[i]; if ( st->time_base.num <= INT64_MAX / ic->bit_rate && st->duration == AV_NOPTS_VALUE) { - duration = av_rescale(8 * filesize, st->time_base.den, + duration = av_rescale(filesize, 8LL * st->time_base.den, ic->bit_rate * (int64_t) st->time_base.num); st->duration = duration;