Commit 593dac80 authored by Marek Olšák's avatar Marek Olšák Committed by Marge Bot

mesa: overallocate program parameter values

See the comment. This is something I spotted in the code. There is
no known bug caused by this.
Reviewed-by: Zoltán Böszörményi's avatarZoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Part-of: <mesa/mesa!8046>
parent 884e8403
......@@ -223,8 +223,12 @@ _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 */
paramList->SizeValues * 4 * sizeof(gl_constant_value),/*new*/
16);
/* Overallocate the size by 12 because matrix rows can
* be allocated partially but fetch_state always writes
* 4 components (16 bytes).
*/
paramList->SizeValues * 4 * sizeof(gl_constant_value) +
12, 16);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment