only allow VERT_ATTRIB_MAX instead of _TNL_ATTRIB_MAX for inputs of vertex programs (fixes a segfault since the result of the shift is undefined otherwise, and it may happen that _TNL_ATTRIB_POINTSIZE will be tried to read, unlike all other attribs this however may be unitialized (might be a bug in itself)).

This commit is contained in:
Roland Scheidegger
2006-09-07 13:26:44 +00:00
parent d016d4e70f
commit 28e7219b96
2 changed files with 2 additions and 2 deletions

View File

@@ -1253,7 +1253,7 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
m->nr_inputs = m->nr_outputs = 0;
for (i = 0; i < _TNL_ATTRIB_MAX; i++) {
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
if (program->Base.InputsRead & (1<<i) ||
(i == VERT_ATTRIB_POS && program->IsPositionInvariant)) {
GLuint j = m->nr_inputs++;