From: Timothy Arceri Date: Wed, 26 Feb 2020 02:21:20 +0000 (+1100) Subject: glsl: fix possible memory leak in nir uniform linker X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7dafc3050da4ab240c8ecf4ddcfba2c6192113f5;p=mesa.git 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 Part-of: --- diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c index 1a6a4fc07a6..1a09843454c 100644 --- a/src/compiler/glsl/gl_nir_link_uniforms.c +++ b/src/compiler/glsl/gl_nir_link_uniforms.c @@ -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;