You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
estimate_timings_from_bit_rate: Check timebase and bitrate
Fixes integer overflow and assertion failure Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -2325,9 +2325,11 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
|
|||||||
if (filesize > 0) {
|
if (filesize > 0) {
|
||||||
for(i = 0; i < ic->nb_streams; i++) {
|
for(i = 0; i < ic->nb_streams; i++) {
|
||||||
st = ic->streams[i];
|
st = ic->streams[i];
|
||||||
duration= av_rescale(8*filesize, st->time_base.den, ic->bit_rate*(int64_t)st->time_base.num);
|
if ( st->time_base.num <= INT64_MAX / ic->bit_rate
|
||||||
if (st->duration == AV_NOPTS_VALUE)
|
&& st->duration == AV_NOPTS_VALUE) {
|
||||||
|
duration= av_rescale(8*filesize, st->time_base.den, ic->bit_rate*(int64_t)st->time_base.num);
|
||||||
st->duration = duration;
|
st->duration = duration;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user