mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
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 <zboszor@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>
This commit is contained in:
parent
884e84035e
commit
593dac8028
1 changed files with 6 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue