mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
mesa/uniform_query: Don't write to *params if there is an error
The GL 3.1 and ES 3.0 specs say of glGetActiveUniformsiv:
"If an error occurs, nothing will be written to params."
So, make a pass through the indices and check that they're valid before
the pass that actually writes to params. Checking pname happens on the
first iteration of the second loop.
Fixes es3conform's getactiveuniformsiv_for_nonexistent_uniform_indices
test.
NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 11cea47246)
This commit is contained in:
parent
460096f5da
commit
5f8a8716b6
1 changed files with 5 additions and 1 deletions
|
|
@ -97,12 +97,16 @@ _mesa_GetActiveUniformsiv(GLuint program,
|
|||
|
||||
for (i = 0; i < uniformCount; i++) {
|
||||
GLuint index = uniformIndices[i];
|
||||
const struct gl_uniform_storage *uni = &shProg->UniformStorage[index];
|
||||
|
||||
if (index >= shProg->NumUserUniformStorage) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformsiv(index)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < uniformCount; i++) {
|
||||
GLuint index = uniformIndices[i];
|
||||
const struct gl_uniform_storage *uni = &shProg->UniformStorage[index];
|
||||
|
||||
switch (pname) {
|
||||
case GL_UNIFORM_TYPE:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue