From 719063d4d07a8f2ab2f256ea697083a8eb07e32a Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 21 Mar 2020 17:54:36 -0400 Subject: st/mesa: fix use of uninitialized memory due to st_nir_lower_builtin reported by valgrind Cc: 19.3 20.0 Reviewed-by: Rob Clark Tested-by: Marge Bot Part-of: --- src/mesa/state_tracker/st_nir_lower_builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_nir_lower_builtin.c b/src/mesa/state_tracker/st_nir_lower_builtin.c index 13425d59619..4227ee5529a 100644 --- a/src/mesa/state_tracker/st_nir_lower_builtin.c +++ b/src/mesa/state_tracker/st_nir_lower_builtin.c @@ -138,7 +138,7 @@ get_variable(lower_builtin_state *state, nir_deref_path *path, nir_variable_create(shader, nir_var_uniform, glsl_vec4_type(), name); var->num_state_slots = 1; - var->state_slots = ralloc_array(var, nir_state_slot, 1); + var->state_slots = rzalloc_array(var, nir_state_slot, 1); memcpy(var->state_slots[0].tokens, tokens, sizeof(var->state_slots[0].tokens)); -- cgit v1.2.3