[FFmpeg-cvslog] avcodec/libxavs: fix division by 0 bitrate

Michael Niedermayer git at videolan.org
Thu Dec 11 13:49:34 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Dec 11 13:25:10 2014 +0100| [27dfe54eb765793b1f8d8cecaed0ee1e507fcf57] | committer: Michael Niedermayer

avcodec/libxavs: fix division by 0 bitrate

Fixes CID1257655

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c
index b061259..30d1479 100644
--- a/libavcodec/libxavs.c
+++ b/libavcodec/libxavs.c
@@ -325,8 +325,9 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
     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