Browse Source

avcodec/libxvid: Partially check plugins array size with assert

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
1ccc2157ff
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/libxvid.c

+ 2
- 0
libavcodec/libxvid.c View File

@@ -641,6 +641,8 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
xvid_enc_create.bquant_ratio = 100 * avctx->b_quant_factor; xvid_enc_create.bquant_ratio = 100 * avctx->b_quant_factor;
if( avctx->max_b_frames > 0 && !x->quicktime_format ) xvid_enc_create.global |= XVID_GLOBAL_PACKED; if( avctx->max_b_frames > 0 && !x->quicktime_format ) xvid_enc_create.global |= XVID_GLOBAL_PACKED;


av_assert0(xvid_enc_create.num_plugins + (!!x->ssim) + (!!x->variance_aq) + (!!x->lumi_aq) <= FF_ARRAY_ELEMS(plugins));

/* Create encoder context */ /* Create encoder context */
xerr = xvid_encore(NULL, XVID_ENC_CREATE, &xvid_enc_create, NULL); xerr = xvid_encore(NULL, XVID_ENC_CREATE, &xvid_enc_create, NULL);
if( xerr ) { if( xerr ) {


Loading…
Cancel
Save