diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-16 13:43:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-05 02:40:31 +0200 |
commit | e5d167149d82a8ca3509a94a62989af5b24a943d (patch) | |
tree | f5bb9214308984dd0eeeeab14766bdba7f4a4c04 /libavformat/utils.c | |
parent | ed71759fd08b1b2c4760c5bc973318c534dc346a (diff) | |
download | ffmpeg-e5d167149d82a8ca3509a94a62989af5b24a943d.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>
Diffstat (limited to 'libavformat/utils.c')
-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 9fa744377c..054cada7f9 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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; |