[FFmpeg-cvslog] xavs: Do not try to set the bitrate tolerance without a bitrate

Luca Barbato git at videolan.org
Mon Aug 24 10:38:04 CEST 2015


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Sun Aug 23 17:57:21 2015 +0200| [167ea1fbf15ecefa30729f9b8d091ed431bf43bd] | committer: Luca Barbato

xavs: Do not try to set the bitrate tolerance without a bitrate

Avoid a division by zero.

Bug-Id: CID 1257655

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=167ea1fbf15ecefa30729f9b8d091ed431bf43bd
---

 libavcodec/libxavs.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c
index f0f5dfd..43b0915 100644
--- a/libavcodec/libxavs.c
+++ b/libavcodec/libxavs.c
@@ -356,8 +356,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
     if (avctx->level > 0)
         x4->params.i_level_idc = avctx->level;
 
-    x4->params.rc.f_rate_tolerance =
-        (float)avctx->bit_rate_tolerance/avctx->bit_rate;
+    if (avctx->bit_rate > 0)
+        x4->params.rc.f_rate_tolerance =
+            (float)avctx->bit_rate_tolerance / avctx->bit_rate;
 
     if ((avctx->rc_buffer_size) &&
         (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) {



More information about the ffmpeg-cvslog mailing list