From e550901efaf65877a5553332681ad8e45415c746 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 6 Sep 2024 16:41:24 +1000 Subject: [PATCH] vkd3d-shader/ir: Free the semantic names of deleted signature elements in shader_signature_merge(). (Valgrind) --- libs/vkd3d-shader/ir.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 15cf5296..68f2e2f7 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -1401,6 +1401,8 @@ static bool shader_signature_merge(struct shader_signature *s, uint8_t range_map else e->interpolation_mode = f->interpolation_mode; } + + vkd3d_free((void *)f->semantic_name); } } element_count = new_count; @@ -1428,6 +1430,12 @@ static bool shader_signature_merge(struct shader_signature *s, uint8_t range_map TRACE("Merging %s, base reg %u, count %u.\n", e->semantic_name, e->register_index, register_count); e->register_count = register_count; e->mask = signature_element_range_expand_mask(e, register_count, range_map); + + for (j = 1; j < register_count; ++j) + { + f = &elements[i + j]; + vkd3d_free((void *)f->semantic_name); + } } } element_count = new_count;