You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Merge remote-tracking branch 'qatar/master'
* qatar/master:
lavf: fix the comparison in an overflow check
Conflicts:
libavformat/utils.c
See: a5d67bc796
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -2220,14 +2220,17 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
|
|||||||
|
|
||||||
/* if bit_rate is already set, we believe it */
|
/* if bit_rate is already set, we believe it */
|
||||||
if (ic->bit_rate <= 0) {
|
if (ic->bit_rate <= 0) {
|
||||||
int64_t 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bit_rate <= INT_MAX)
|
|
||||||
ic->bit_rate = bit_rate;
|
ic->bit_rate = bit_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user