vkd3d-shader/spirv: Take ownership of the shader signatures in spirv_compiler_create().

Fixes leakage of the replacement elements in shader_signature_merge().
This commit is contained in:
Conor McCarthy
2023-06-16 21:44:50 +10:00
committed by Alexandre Julliard
parent df0a031ad8
commit bce2a898b3
Notes: Alexandre Julliard 2023-06-19 23:03:34 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/238
2 changed files with 10 additions and 4 deletions

View File

@@ -715,8 +715,7 @@ static bool shader_signature_merge(struct shader_signature *s, uint8_t range_map
}
}
element_count = new_count;
/* Signature 's' is a copy of the original signature struct, so we can replace
* the 'elements' pointer without freeing it. */
vkd3d_free(s->elements);
s->elements = elements;
s->element_count = element_count;