From: Brian Paul Date: Sat, 28 Jun 2008 22:47:22 +0000 (-0600) Subject: s/GL_INVALID_VALUE/GL_INVALID_OPERATION/ in _mesa_get_uniformfv() X-Git-Tag: 062012170305~17580^2~390^2~1071 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2242769a13de228df10fb55d50aa4d96c99d5975;p=profile%2Fivi%2Fmesa.git s/GL_INVALID_VALUE/GL_INVALID_OPERATION/ in _mesa_get_uniformfv() --- diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 97edb25..a005c90 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) { - GLuint 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)"); } }