Check for null program->Parameters pointer in validate_vertex_program().
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 15 Jul 2005 22:48:09 +0000 (22:48 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 15 Jul 2005 22:48:09 +0000 (22:48 +0000)
GL_NV_vertex_program programs can't directly reference GL state so this
pointer is always NULL.

src/mesa/tnl/t_vb_arbprogram.c

index fd7ffcd84c8f18f2e6d462934b9071758c7ba053..c55fc84feaafe9b3e73880a0504d9d5369485e0f 100644 (file)
@@ -1354,7 +1354,11 @@ validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage )
        */
       m->File[FILE_LOCAL_PARAM] = program->Base.LocalParams;
       m->File[FILE_ENV_PARAM] = ctx->VertexProgram.Parameters;
-      m->File[FILE_STATE_PARAM] = program->Parameters->ParameterValues;
+      /* GL_NV_vertex_programs can't reference GL state */
+      if (program->Parameters)
+         m->File[FILE_STATE_PARAM] = program->Parameters->ParameterValues;
+      else
+         m->File[FILE_STATE_PARAM] = NULL;
    }
 }