Browse Source

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

Avoid a division by zero.

Bug-Id: CID 1257655
tags/n2.8
Luca Barbato 9 years ago
parent
commit
167ea1fbf1
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      libavcodec/libxavs.c

+ 3
- 2
libavcodec/libxavs.c View File

@@ -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)) {


Loading…
Cancel
Save