From af23c81afa5c502a45e2af204d98080af96ba6d2 Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Mon, 19 Dec 2022 14:25:03 +0200 Subject: [PATCH] [mtt] Fix reading uninitialized data for local chroma tree --- src/search.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/search.c b/src/search.c index 10b2ae35..c1e1a153 100644 --- a/src/search.c +++ b/src/search.c @@ -190,15 +190,27 @@ static INLINE void initialize_partial_work_tree( to->top_ref = from->top_ref; *LCU_GET_TOP_RIGHT_CU(to) = *LCU_GET_TOP_RIGHT_CU(from); } - } - if (x_limit != LCU_WIDTH >> (tree_type == UVG_CHROMA_T)) { - for (int y = y_start; y < y_limit; y += SCU_WIDTH) { - memset(LCU_GET_CU_AT_PX(to, x_limit, y), 0, sizeof(cu_info_t)); + if (x_limit != LCU_WIDTH >> (tree_type == UVG_CHROMA_T)) { + for (int y = y_start; y < y_limit; y += SCU_WIDTH) { + memset(LCU_GET_CU_AT_PX(to, x_limit, y), 0, sizeof(cu_info_t)); + } + } + if (y_limit != LCU_WIDTH >> (tree_type == UVG_CHROMA_T)) { + for (int x = x_start; x < x_limit; x += SCU_WIDTH) { + memset(LCU_GET_CU_AT_PX(to, x, y_limit), 0, sizeof(cu_info_t)); + } } } - if (y_limit != LCU_WIDTH >> (tree_type == UVG_CHROMA_T)) { - for (int x = x_start; x < x_limit; x += SCU_WIDTH) { - memset(LCU_GET_CU_AT_PX(to, x, y_limit), 0, sizeof(cu_info_t)); + else { + if (x_limit != LCU_WIDTH >> (tree_type == UVG_CHROMA_T)) { + for (int y = y_start; y < y_limit; y += SCU_WIDTH) { + memset(LCU_GET_CU_AT_PX(to, x_limit, y), 0, sizeof(cu_info_t)); + } + } + if (y_limit != LCU_WIDTH >> (tree_type == UVG_CHROMA_T)) { + for (int x = x_start; x < x_limit; x += SCU_WIDTH) { + memset(LCU_GET_CU_AT_PX(to, x, y_limit), 0, sizeof(cu_info_t)); + } } } }