From: Brian Paul Date: Sat, 4 Nov 2006 17:28:38 +0000 (+0000) Subject: fix for glGetVertexAttribfvARB, bug 8883 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=590b557b10ccff7135d76ec800b944c8901c5141;p=mesa.git fix for glGetVertexAttribfvARB, bug 8883 --- diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index e1b2a94c8aa..baba887912c 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -102,7 +102,7 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (index == 0 || index >= MAX_VERTEX_PROGRAM_ATTRIBS) { + if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribfvARB(index)"); return; } @@ -124,6 +124,11 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Normalized; break; case GL_CURRENT_VERTEX_ATTRIB_ARB: + if (index == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetVertexAttribfvARB(pname)"); + return; + } FLUSH_CURRENT(ctx, 0); COPY_4V(params, ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index]); break;