Commit 635b2ec5 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/utils: Do not compute the bitrate from duration == 0

Fixes division by 0 in fate-acodec-ra144
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6085d6b2
......@@ -2529,7 +2529,7 @@ static void update_stream_timings(AVFormatContext *ic)
if (duration != INT64_MIN && duration > 0 && ic->duration == AV_NOPTS_VALUE) {
ic->duration = duration;
}
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration != AV_NOPTS_VALUE) {
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration > 0) {
/* compute the bitrate */
double bitrate = (double) filesize * 8.0 * AV_TIME_BASE /
(double) ic->duration;
......
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