aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/uniform_query.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-12 16:45:42 +0100
committermarha <marha@users.sourceforge.net>2014-03-12 16:45:42 +0100
commitcc6db22a772cc52ead6a5c11d7d02e7364f6326c (patch)
treed80b42172d703ec20ccd99c68a067505e2706899 /mesalib/src/mesa/main/uniform_query.cpp
parent2112b7dec49833ba872bd3ebcd7288930fec0796 (diff)
parentcd8b0d0de3fcb53f6d3ece8ce26d97aaab2c0914 (diff)
downloadvcxsrv-cc6db22a772cc52ead6a5c11d7d02e7364f6326c.tar.gz
vcxsrv-cc6db22a772cc52ead6a5c11d7d02e7364f6326c.tar.bz2
vcxsrv-cc6db22a772cc52ead6a5c11d7d02e7364f6326c.zip
Merge remote-tracking branch 'origin/released'
* origin/released: mesa xserver xkbcomp git update 12 Mar 2014
Diffstat (limited to 'mesalib/src/mesa/main/uniform_query.cpp')
-rw-r--r--mesalib/src/mesa/main/uniform_query.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/mesalib/src/mesa/main/uniform_query.cpp b/mesalib/src/mesa/main/uniform_query.cpp
index 8cc5da752..fa13ef9fe 100644
--- a/mesalib/src/mesa/main/uniform_query.cpp
+++ b/mesalib/src/mesa/main/uniform_query.cpp
@@ -40,9 +40,9 @@
extern "C" void GLAPIENTRY
-_mesa_GetActiveUniform(GLhandleARB program, GLuint index,
- GLsizei maxLength, GLsizei *length, GLint *size,
- GLenum *type, GLcharARB *nameOut)
+_mesa_GetActiveUniform(GLuint program, GLuint index,
+ GLsizei maxLength, GLsizei *length, GLint *size,
+ GLenum *type, GLcharARB *nameOut)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_shader_program *shProg =
@@ -246,14 +246,15 @@ validate_uniform_parameters(struct gl_context *ctx,
return false;
}
- _mesa_uniform_split_location_offset(shProg, location, loc, array_index);
-
- if (*loc >= shProg->NumUserUniformStorage) {
+ /* Check that the given location is in bounds of uniform remap table. */
+ if (location >= (GLint) shProg->NumUniformRemapTable) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(location=%d)",
caller, location);
return false;
}
+ _mesa_uniform_split_location_offset(shProg, location, loc, array_index);
+
if (shProg->UniformStorage[*loc].array_elements == 0 && count > 1) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(count > 1 for non-array, location=%d)",