glsl: fix possible memory leak in nir uniform linker

Use UniformDataSlots for the context of UniformDataDefaults rather
than UniformStorage as in some cause UniformStorage may be NULL.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3992>
This commit is contained in:
Timothy Arceri
2020-02-26 13:21:20 +11:00
committed by Marge Bot
parent cf12faef61
commit 7dafc3050d
+1 -1
View File
@@ -55,7 +55,7 @@ nir_setup_uniform_remap_tables(struct gl_context *ctx,
prog->data->UniformDataSlots = data;
prog->data->UniformDataDefaults =
rzalloc_array(prog->data->UniformStorage,
rzalloc_array(prog->data->UniformDataSlots,
union gl_constant_value, prog->data->NumUniformDataSlots);
unsigned data_pos = 0;