From 835f576eef11a57b72e349857f3bc0845ed0e910 Mon Sep 17 00:00:00 2001 From: siivonek Date: Mon, 21 Mar 2022 19:59:57 +0200 Subject: [PATCH] [lfnst] Fix error in writing lfnst constraints. Added check to test if CU data exists before referencing it. --- src/strategies/generic/encode_coding_tree-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategies/generic/encode_coding_tree-generic.c b/src/strategies/generic/encode_coding_tree-generic.c index b35b8937..2bfe506a 100644 --- a/src/strategies/generic/encode_coding_tree-generic.c +++ b/src/strategies/generic/encode_coding_tree-generic.c @@ -103,7 +103,7 @@ void uvg_encode_coeff_nxn_generic(encoder_state_t * const state, last_coeff_x = (uint8_t)(pos_last - (last_coeff_y * width)); bool is_chroma = !is_luma; - if (cur_cu->tr_idx != MTS_SKIP && height >= 4 && width >= 4) { + if (cur_cu != NULL && cur_cu->tr_idx != MTS_SKIP && height >= 4 && width >= 4) { const int max_lfnst_pos = ((height == 4 && width == 4) || (height == 8 && width == 8)) ? 7 : 15; cur_cu->violates_lfnst_constrained[is_chroma] |= scan_pos_last > max_lfnst_pos; cur_cu->lfnst_last_scan_pos |= scan_pos_last >= 1;