summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/shader_api.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-06-28 16:48:31 -0600
committerBrian Paul <[email protected]>2008-06-28 16:48:58 -0600
commit6cb12704916822aa4d0895a6427e110afe4bfa58 (patch)
tree49182c22eea5fe7357dcfaadb2dc440eff20e4d9 /src/mesa/shader/shader_api.c
parentb429e9b2d74ece0906602d2f843c0f8bf74c44f4 (diff)
s/GL_INVALID_VALUE/GL_INVALID_OPERATION/ in _mesa_get_uniformfv()
Diffstat (limited to 'src/mesa/shader/shader_api.c')
-rw-r--r--src/mesa/shader/shader_api.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 0bb96a0d6c0..c9eec7f07ee 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -892,8 +892,10 @@ _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
struct gl_shader_program *shProg
= _mesa_lookup_shader_program(ctx, program);
if (shProg) {
- if (location < shProg->Uniforms->NumUniforms) {
- GLint progPos, i;
+ if (shProg->Uniforms &&
+ location >= 0 && location < shProg->Uniforms->NumUniforms) {
+ GLint progPos;
+ GLuint i;
const struct gl_program *prog = NULL;
progPos = shProg->Uniforms->Uniforms[location].VertPos;
@@ -915,11 +917,11 @@ _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
}
}
else {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetUniformfv(location)");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)");
}
}
else {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetUniformfv(program)");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(program)");
}
}