From 635b2ec5f20d6cdef1adf4907ca28f8f09abcecc Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 16 May 2016 13:43:02 +0200 Subject: [PATCH] avformat/utils: Do not compute the bitrate from duration == 0 Fixes division by 0 in fate-acodec-ra144 Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 774a2ba4f3d..5f5f03e6ec3 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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; -- 2.39.2