mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit 'df33a58e5311ee9a64a573889b883a80e981af7b'
* commit 'df33a58e5311ee9a64a573889b883a80e981af7b': lavf: avoid integer overflow when estimating bitrate Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
d07d54fd56
|
@ -2222,9 +2222,14 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
|
||||||
int bit_rate = 0;
|
int bit_rate = 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];
|
||||||
if (st->codec->bit_rate > 0)
|
if (st->codec->bit_rate > 0) {
|
||||||
|
if (INT_MAX - st->codec->bit_rate > bit_rate) {
|
||||||
|
bit_rate = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
bit_rate += st->codec->bit_rate;
|
bit_rate += st->codec->bit_rate;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ic->bit_rate = bit_rate;
|
ic->bit_rate = bit_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue