mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-24 12:09:55 +00:00
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
This commit is contained in:
parent
fee0deb61f
commit
9100d4d632
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user