summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-05-29 14:37:56 +0000
committerBrian Paul <[email protected]>2006-05-29 14:37:56 +0000
commit919f6a070c871a8e60053306145f0971c69d699b (patch)
tree986be26ff660195d8ff0aef4ff57e6b49d62ad16 /src/mesa
parent76b6e88e56a065eb7c169e9d2da57633fb83c486 (diff)
generic attribute 0 wasn't handled correctly (Jesse Allen)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/arbprogparse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index b596b79bc79..cdf1b3dc1d2 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -1538,12 +1538,20 @@ parse_attrib_binding(GLcontext * ctx, GLubyte ** inst,
GLuint attrib;
if (!parse_generic_attrib_num(ctx, inst, Program, &attrib)) {
*is_generic = 1;
+ if (attrib >= MAX_VERTEX_PROGRAM_ATTRIBS) {
+ const char *msg = "Invalid generic vertex attribute reference";
+ _mesa_set_program_error (ctx, Program->Position, msg);
+ _mesa_error (ctx, GL_INVALID_OPERATION, msg);
+ return 1;
+ }
/* Add VERT_ATTRIB_GENERIC0 here because ARB_vertex_program's
* attributes do not alias the conventional vertex
* attributes.
*/
if (attrib > 0)
*inputReg = attrib + VERT_ATTRIB_GENERIC0;
+ else
+ *inputReg = 0;
}
}
break;