Module: Mesa
Branch: main
Commit: 24555f5462e97e80ffe20f47a279d3c344fa6ea2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=24555f5462e97e80ffe20f47a279d3c344fa6ea2

Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Apr 18 12:23:21 2023 -0400

nir/lower_alpha_test: rzalloc state slots

this otherwise leads to uninitialized memory

cc: mesa-stable

Reviewed-by: Erik Faye-Lund <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22558>

---

 src/compiler/nir/nir_lower_alpha_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_alpha_test.c 
b/src/compiler/nir/nir_lower_alpha_test.c
index 6ac2cfc8d8e..89b6c7366a8 100644
--- a/src/compiler/nir/nir_lower_alpha_test.c
+++ b/src/compiler/nir/nir_lower_alpha_test.c
@@ -100,7 +100,7 @@ nir_lower_alpha_test(nir_shader *shader, enum compare_func 
func,
                                                        glsl_float_type(),
                                                        "gl_AlphaRefMESA");
                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,
                       alpha_ref_state_tokens,
                       sizeof(var->state_slots[0].tokens));

Reply via email to