avformat/utils: change bit_rate to 64 bit in estimate_timings_from_bit_rate()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/221/head
Michael Niedermayer 9 years ago
parent a9eda4b260
commit 4fecb97fd3
  1. 4
      libavformat/utils.c

@ -2565,11 +2565,11 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
/* if bit_rate is already set, we believe it */
if (ic->bit_rate <= 0) {
int bit_rate = 0;
int64_t bit_rate = 0;
for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
if (st->codecpar->bit_rate > 0) {
if (INT_MAX - st->codecpar->bit_rate < bit_rate) {
if (INT64_MAX - st->codecpar->bit_rate < bit_rate) {
bit_rate = 0;
break;
}

Loading…
Cancel
Save