mesa: fix crashes in the no_error path of glUniform

Fixes: bd2662bfa1 - mesa: add KHR_no_error support to glUniform*() functions

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13417>
This commit is contained in:
Marek Olšák 2021-10-18 12:39:08 -04:00 committed by Marge Bot
parent 5948ff4826
commit 03186773a6

View file

@ -1280,7 +1280,7 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
return;
uni = shProg->UniformRemapTable[location];
if (!uni)
if (!uni || uni == INACTIVE_UNIFORM_EXPLICIT_LOCATION)
return;
/* The array index specified by the uniform location is just the
@ -1846,6 +1846,8 @@ _mesa_uniform_handle(GLint location, GLsizei count, const GLvoid *values,
return;
uni = shProg->UniformRemapTable[location];
if (!uni || uni == INACTIVE_UNIFORM_EXPLICIT_LOCATION)
return;
/* The array index specified by the uniform location is just the
* uniform location minus the base location of of the uniform.