Browse Source

update_stream_timings: check bitrate for being in range.

Fixes numerical overflow
Fixes Ticket2089

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.2
Michael Niedermayer 13 years ago
parent
commit
7992bdbeb4
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavformat/utils.c

+ 3
- 1
libavformat/utils.c View File

@@ -2230,8 +2230,10 @@ static void update_stream_timings(AVFormatContext *ic)
}
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration != AV_NOPTS_VALUE) {
/* compute the bitrate */
ic->bit_rate = (double)filesize * 8.0 * AV_TIME_BASE /
double bitrate = (double)filesize * 8.0 * AV_TIME_BASE /
(double)ic->duration;
if (bitrate >= 0 && bitrate <= INT_MAX)
ic->bit_rate = bitrate;
}
}



Loading…
Cancel
Save