diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-16 13:43:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-16 14:23:49 +0200 |
commit | 635b2ec5f20d6cdef1adf4907ca28f8f09abcecc (patch) | |
tree | a627206f8be0015c03e515238208e802f52a7409 /libavformat/utils.c | |
parent | 6085d6b2aeef28671614f625601a23cfc922d282 (diff) | |
download | ffmpeg-635b2ec5f20d6cdef1adf4907ca28f8f09abcecc.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>
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 774a2ba4f3..5f5f03e6ec 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; |