Fix num_4x4_blk scale in var-tx and cb4x4 mode This resolves an out-of-boundary memory access issue in the encoding process. Change-Id: I9363f5a5a012880289e3370f66507126c609a41f
diff --git a/av1/encoder/context_tree.c b/av1/encoder/context_tree.c index 561ed9c..42a803a 100644 --- a/av1/encoder/context_tree.c +++ b/av1/encoder/context_tree.c
@@ -30,7 +30,12 @@ const int num_blk = (num_4x4_blk < 4 ? 4 : num_4x4_blk); const int num_pix = num_blk * tx_size_2d[0]; int i; +#if CONFIG_CB4X4 && CONFIG_VAR_TX + ctx->num_4x4_blk = num_blk / 4; +#else ctx->num_4x4_blk = num_blk; +#endif + #if CONFIG_EXT_PARTITION_TYPES ctx->partition = partition; #endif