aux/util: initialize variables in u_visibility_mask_get_default

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2140>
This commit is contained in:
Simon Zeni 2024-06-28 14:26:07 -04:00
parent 9221bf797c
commit a178a6d226

View file

@ -44,7 +44,7 @@ u_visibility_mask_get_default(enum xrt_visibility_mask_type type,
struct xrt_visibility_mask **out_mask) struct xrt_visibility_mask **out_mask)
{ {
struct xrt_visibility_mask *mask = NULL; struct xrt_visibility_mask *mask = NULL;
uint32_t nvertices, nindices; uint32_t nvertices = 0, nindices = 0;
switch (type) { switch (type) {
case XRT_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH: case XRT_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH:
@ -73,8 +73,8 @@ u_visibility_mask_get_default(enum xrt_visibility_mask_type type,
mask->index_count = nindices; mask->index_count = nindices;
mask->vertex_count = nvertices; mask->vertex_count = nvertices;
const struct xrt_vec2 *vertices; const struct xrt_vec2 *vertices = NULL;
const uint32_t *indices; const uint32_t *indices = NULL;
switch (type) { switch (type) {
case XRT_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH: case XRT_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH: