diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-05 15:01:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-05 15:06:04 +0200 |
commit | 1ccc2157ff46ddab44357f2ca2f312ffc593ed22 (patch) | |
tree | 52b9f19371ae6495ee14ec06929300f85df0ea9b | |
parent | 412df0a52f24d104131c17755212471818b5748b (diff) | |
download | ffmpeg-1ccc2157ff46ddab44357f2ca2f312ffc593ed22.tar.gz |
avcodec/libxvid: Partially check plugins array size with assert
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/libxvid.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index d1d4114249..680ec6a3fd 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -641,6 +641,8 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { 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; + av_assert0(xvid_enc_create.num_plugins + (!!x->ssim) + (!!x->variance_aq) + (!!x->lumi_aq) <= FF_ARRAY_ELEMS(plugins)); + /* Create encoder context */ xerr = xvid_encore(NULL, XVID_ENC_CREATE, &xvid_enc_create, NULL); if( xerr ) { |