From: Angie Chiang Date: Tue, 29 Jan 2019 23:36:38 +0000 (-0800) Subject: Allocate memory for mv_mode_arr[] X-Git-Tag: v1.8.1~273^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93d1822d5f49363a0220a75d3d041ada02338b1f;p=libvpx Allocate memory for mv_mode_arr[] Change-Id: Ib9fdf65e263dbaace8d4c86766eba2c6f35f652b --- diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index eaeb3d96e..a6117b190 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -2583,6 +2583,7 @@ void vp9_remove_compressor(VP9_COMP *cpi) { for (sqr_bsize = 0; sqr_bsize < SQUARE_BLOCK_SIZES; ++sqr_bsize) { vpx_free(cpi->tpl_stats[frame].pyramid_mv_arr[rf_idx][sqr_bsize]); } + vpx_free(cpi->tpl_stats[frame].mv_mode_arr[rf_idx]); } #endif vpx_free(cpi->tpl_stats[frame].tpl_stats_ptr); @@ -6783,6 +6784,11 @@ static void init_tpl_buffer(VP9_COMP *cpi) { sizeof( *cpi->tpl_stats[frame].pyramid_mv_arr[rf_idx][sqr_bsize]))); } + vpx_free(cpi->tpl_stats[frame].mv_mode_arr[rf_idx]); + CHECK_MEM_ERROR( + cm, cpi->tpl_stats[frame].mv_mode_arr[rf_idx], + vpx_calloc(mi_rows * mi_cols * 4, + sizeof(*cpi->tpl_stats[frame].mv_mode_arr[rf_idx]))); } #endif vpx_free(cpi->tpl_stats[frame].tpl_stats_ptr);