mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 23:50:11 +01:00
glsl: on UBO/SSBOs link error reset the number of active blocks to 0
While it's legal to have an active blocks count > 0 on link failure. Unless we actually assign memory for the blocks array we can end up segfaulting in calls such as glUniformBlockBinding(). To avoid having to NULL check these api calls we simply reset the block count to 0 if the array was not created. Signed-off-by: Andres Gomez <agomez@igalia.com> Cc: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
c4c02471f4
commit
bf15b2b515
1 changed files with 6 additions and 0 deletions
|
|
@ -1181,6 +1181,12 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog,
|
|||
for (unsigned k = 0; k <= i; k++) {
|
||||
delete[] InterfaceBlockStageIndex[k];
|
||||
}
|
||||
|
||||
/* Reset the block count. This will help avoid various segfaults
|
||||
* from api calls that assume the array exists due to the count
|
||||
* being non-zero.
|
||||
*/
|
||||
*num_blks = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue