Commit 7cf0472e authored by Michael Niedermayer's avatar Michael Niedermayer

Fix assertion failure due to frames being 0 in mp3 vbr bitrate calculation.

Fixes issue 2442.

Originally committed as revision 26121 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 1f0920db
...@@ -128,7 +128,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base) ...@@ -128,7 +128,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
if(frames) if(frames)
st->duration = av_rescale_q(frames, (AVRational){spf, c.sample_rate}, st->duration = av_rescale_q(frames, (AVRational){spf, c.sample_rate},
st->time_base); st->time_base);
if(size) if(size && frames)
st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf); st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf);
return 0; return 0;
......
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