Commit 37fe5fbc authored by Yaowu Xu's avatar Yaowu Xu

Prevent access array with -1 index

Change-Id: I9fdf3b543a00700d47b3012b3de7b30ae455900f
parent 446d037b
...@@ -847,7 +847,7 @@ static int prune_one_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize, ...@@ -847,7 +847,7 @@ static int prune_one_for_sby(const AV1_COMP *cpi, BLOCK_SIZE bsize,
static int prune_tx_types(const AV1_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x, static int prune_tx_types(const AV1_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x,
const MACROBLOCKD *const xd, int tx_set) { const MACROBLOCKD *const xd, int tx_set) {
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
const int *tx_set_1D = ext_tx_used_inter_1D[tx_set]; const int *tx_set_1D = tx_set >= 0 ? ext_tx_used_inter_1D[tx_set] : NULL;
#else #else
const int tx_set_1D[TX_TYPES_1D] = { 0 }; const int tx_set_1D[TX_TYPES_1D] = { 0 };
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
......
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