From 27d114bc082358ca0bab69f17f242a9363292fbc Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Mon, 19 Dec 2022 09:59:33 +0200 Subject: [PATCH] [mtt] Fix negative indexing --- src/strategies/generic/dct-generic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/strategies/generic/dct-generic.c b/src/strategies/generic/dct-generic.c index fec783b6..2a673d21 100644 --- a/src/strategies/generic/dct-generic.c +++ b/src/strategies/generic/dct-generic.c @@ -2599,8 +2599,8 @@ static void mts_dct_generic( } } - partial_tr_func* dct_hor = dct_table[type_hor][log2_width_minus1]; - partial_tr_func* dct_ver = dct_table[type_ver][log2_height_minus1]; + partial_tr_func* dct_hor = width != 1 ? dct_table[type_hor][log2_width_minus1] : NULL; + partial_tr_func* dct_ver = height != 1 ? dct_table[type_ver][log2_height_minus1] : NULL; int16_t tmp[32 * 32]; const int32_t shift_1st = log2_width_minus1 + bitdepth - 8; @@ -2655,8 +2655,8 @@ static void mts_idct_generic( } } - partial_tr_func* idct_hor = idct_table[type_hor][log2_width_minus1]; - partial_tr_func* idct_ver = idct_table[type_ver][log2_height_minus1]; + partial_tr_func* idct_hor = width != 1 ? idct_table[type_hor][log2_width_minus1] : NULL; + partial_tr_func* idct_ver = height != 1 ? idct_table[type_ver][log2_height_minus1] : NULL; int16_t tmp[32 * 32]; const int max_log2_tr_dynamic_range = 15;