Commit 9100d4d6 authored by David Czech's avatar David Czech Committed by Carl Eugen Hoyos

Fix crash if invalid bit-rate was read from file.

Fixes issue 2426.

Patch by David Czech, davidczech510 gmail

Originally committed as revision 26061 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent fee0deb6
......@@ -1870,10 +1870,11 @@ static void av_estimate_timings_from_bit_rate(AVFormatContext *ic)
AVStream *st;
/* if bit_rate is already set, we believe it */
if (ic->bit_rate == 0) {
if (ic->bit_rate <= 0) {
bit_rate = 0;
for(i=0;i<ic->nb_streams;i++) {
st = ic->streams[i];
if (st->codec->bit_rate > 0)
bit_rate += st->codec->bit_rate;
}
ic->bit_rate = bit_rate;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment