From e91dec36bc467deec90a4866d270f90de0895ee8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 2 Mar 2021 04:17:46 -0500 Subject: [PATCH] mesa: fix a oldNum typo in reallocation in _mesa_reserve_parameter_storage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit oldNum was incorrect. oldValNum is the correct number of elements to copy inside realloc. (oldNum is for Parameters, not ParameterValues) Reviewed-by: Zoltán Böszörményi Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mesa/program/prog_parameter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index f1b7b71..a8940f8 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -223,7 +223,7 @@ _mesa_reserve_parameter_storage(struct gl_program_parameter_list *paramList, paramList->ParameterValues = (gl_constant_value *) align_realloc(paramList->ParameterValues, /* old buf */ - oldNum * 4 * sizeof(gl_constant_value),/* old sz */ + oldValNum * 4 * sizeof(gl_constant_value),/* old sz */ /* Overallocate the size by 12 because matrix rows can * be allocated partially but fetch_state always writes * 4 components (16 bytes). -- 2.7.4