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

Avoid a division by zero.

Bug-Id: CID 1257655
This commit is contained in:
Luca Barbato 2015-08-23 17:57:21 +02:00
parent 61d8fa2a1a
commit 167ea1fbf1

View File

@ -356,6 +356,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (avctx->level > 0) if (avctx->level > 0)
x4->params.i_level_idc = avctx->level; x4->params.i_level_idc = avctx->level;
if (avctx->bit_rate > 0)
x4->params.rc.f_rate_tolerance = x4->params.rc.f_rate_tolerance =
(float)avctx->bit_rate_tolerance / avctx->bit_rate; (float)avctx->bit_rate_tolerance / avctx->bit_rate;