mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-24 08:10:22 +01:00
mesa: Add missing check for glUniform*v count > 1 on non-array
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Tested-by: Tom Stellard <thomas.stellard@amd.com>
This commit is contained in:
parent
719909698c
commit
c42ca36d67
1 changed files with 9 additions and 0 deletions
|
|
@ -399,6 +399,8 @@ validate_uniform_parameters(struct gl_context *ctx,
|
|||
*
|
||||
* - if no variable with a location of location exists in the
|
||||
* program object currently in use and location is not -1,
|
||||
* - if count is greater than one, and the uniform declared in the
|
||||
* shader is not an array variable,
|
||||
*/
|
||||
if (location < -1) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(location=%d)",
|
||||
|
|
@ -414,6 +416,13 @@ validate_uniform_parameters(struct gl_context *ctx,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (shProg->UniformStorage[*loc].array_elements == 0 && count > 1) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"%s(count > 1 for non-array, location=%d)",
|
||||
caller, location);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* This case should be impossible. The implication is that a call like
|
||||
* glGetUniformLocation(prog, "foo[8]") was successful but "foo" is not an
|
||||
* array.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue