GET_CURRENT_CONTEXT(ctx);
struct gl_shader_program *shProg;
+ if (maxLength < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(maxLength < 0)");
+ return;
+ }
+
shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
if (!shProg)
return;
get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount,
GLsizei *count, GLuint *obj)
{
- struct gl_shader_program *shProg =
+ struct gl_shader_program *shProg;
+
+ if (maxCount < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetAttachedShaders(maxCount < 0)");
+ return;
+ }
+
+ shProg =
_mesa_lookup_shader_program_err(ctx, program, "glGetAttachedShaders");
+
if (shProg) {
GLuint i;
for (i = 0; i < (GLuint) maxCount && i < shProg->NumShaders; i++) {
GLsizei *length, GLchar *sourceOut)
{
struct gl_shader *sh;
+
+ if (maxLength < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderSource(bufSize < 0)");
+ return;
+ }
+
sh = _mesa_lookup_shader_err(ctx, shader, "glGetShaderSource");
if (!sh) {
return;
GLsizei length_dummy;
GET_CURRENT_CONTEXT(ctx);
+ if (bufSize < 0){
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramBinary(bufSize < 0)");
+ return;
+ }
+
shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetProgramBinary");
if (!shProg)
return;
return;
}
- if (bufSize < 0){
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramBinary(bufSize < 0)");
- return;
- }
-
*length = 0;
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramBinary(driver supports zero binary formats)");
GLenum *type, GLcharARB *nameOut)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl_shader_program *shProg =
- _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniform");
+ struct gl_shader_program *shProg;
+ if (maxLength < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform(maxLength < 0)");
+ return;
+ }
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniform");
if (!shProg)
return;
struct gl_shader_program *shProg;
GLsizei i;
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniform");
- if (!shProg)
- return;
-
if (uniformCount < 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glGetActiveUniformsiv(uniformCount < 0)");
return;
}
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniform");
+ if (!shProg)
+ return;
+
for (i = 0; i < uniformCount; i++) {
GLuint index = uniformIndices[i];