From 37fe5fbced53b688da8220b1f653c561a84a2db6 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Tue, 9 May 2017 11:43:45 -0700 Subject: [PATCH] Prevent access array with -1 index Change-Id: I9fdf3b543a00700d47b3012b3de7b30ae455900f --- av1/encoder/rdopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index 55e391c58..79eea7968 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c @@ -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, const MACROBLOCKD *const xd, int tx_set) { #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 const int tx_set_1D[TX_TYPES_1D] = { 0 }; #endif // CONFIG_EXT_TX -- GitLab