[FFmpeg-cvslog] avcodec/libxvid: Partially check plugins array size with assert
Michael Niedermayer
git at videolan.org
Mon Aug 5 15:10:46 CEST 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Aug 5 15:01:20 2013 +0200| [1ccc2157ff46ddab44357f2ca2f312ffc593ed22] | committer: Michael Niedermayer
avcodec/libxvid: Partially check plugins array size with assert
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ccc2157ff46ddab44357f2ca2f312ffc593ed22
---
libavcodec/libxvid.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index d1d4114..680ec6a 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 ) {
More information about the ffmpeg-cvslog
mailing list