From f0da96145cb068ade0f0232d0682137c9065929f Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Mon, 22 Feb 2010 13:04:47 -0800 Subject: [PATCH] Fix overread of scratch buffer Could cause crashes on non-mod16 frames. --- encoder/encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encoder/encoder.c b/encoder/encoder.c index df62389b..89bf4571 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -1055,7 +1055,7 @@ x264_t *x264_encoder_open( x264_param_t *param ) /* Allocate scratch buffer */ for( i = 0; i < h->param.i_threads + !!h->param.i_sync_lookahead; i++ ) { - int buf_hpel = (h->param.i_width+48) * sizeof(int16_t); + int buf_hpel = (h->fdec->i_width[0]+48) * sizeof(int16_t); int buf_ssim = h->param.analyse.b_ssim * 8 * (h->param.i_width/4+3) * sizeof(int); int me_range = X264_MIN(h->param.analyse.i_me_range, h->param.analyse.i_mv_range); int buf_tesa = (h->param.analyse.i_me_method >= X264_ME_ESA) * -- 2.47.3