diff options
author | David Czech <davidczech510@gmail.com> | 2010-12-20 09:58:27 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2010-12-20 09:58:27 +0000 |
commit | 9100d4d6327b077c44e5fdbc8082255f11953978 (patch) | |
tree | efa17ece99913a6ffae635bfbaf6c3eb230cea87 /libavformat | |
parent | fee0deb61fa6e306009ad8d32967e6c66a5c3b2e (diff) | |
download | ffmpeg-9100d4d6327b077c44e5fdbc8082255f11953978.tar.gz |
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
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index c8e6d6602a..61aa7d45e7 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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; |