1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-19 05:49:09 +02:00

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

Fixes division by 0 in fate-acodec-ra144

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 635b2ec5f20d6cdef1adf4907ca28f8f09abcecc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-05-16 13:43:02 +02:00
parent ed71759fd0
commit e5d167149d

View File

@ -2408,7 +2408,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;