mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
[lfnst] Fix error in writing lfnst constraints. Added check to test if CU data exists before referencing it.
This commit is contained in:
parent
e11fd3154d
commit
835f576eef
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue