diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-16 13:43:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-23 13:15:16 +0200 |
commit | 6d560d4a0b8d57ab4e7ac2cee183d7a1bfa67428 (patch) | |
tree | 906337241ae45bf69799ebee73e1f11ba11695da /libavformat | |
parent | 8d257c3680a9b1060ab1834df2ce498266f658eb (diff) | |
download | ffmpeg-6d560d4a0b8d57ab4e7ac2cee183d7a1bfa67428.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')
-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 28227ff3d1..9d996fed4e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2244,7 +2244,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; |