Commit 2ee81fec authored by Jingning Han's avatar Jingning Han

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
parent 6ae7564b
......@@ -30,7 +30,12 @@ static void alloc_mode_context(AV1_COMMON *cm, int num_4x4_blk,
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment