diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-16 13:43:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-15 18:54:34 +0200 |
commit | 2e0af764b32f76859d6b441812e2e2c9b5c1bed3 (patch) | |
tree | 2b38a90e046dbd7e192e9ee86c246cb81d7a58ea | |
parent | 8857dc6cd856b9f1eaf6c7f6c76b55f2ca95ef59 (diff) | |
download | ffmpeg-2e0af764b32f76859d6b441812e2e2c9b5c1bed3.tar.gz |
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>
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index d40ae64411..d638ace640 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2372,7 +2372,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; |