check for null program ptrs in _mesa_uniform()
authorBrian <brian@yutani.localnet.net>
Wed, 7 Mar 2007 15:04:06 +0000 (08:04 -0700)
committerBrian <brian@yutani.localnet.net>
Wed, 7 Mar 2007 15:04:06 +0000 (08:04 -0700)
src/mesa/shader/shader_api.c

index 48ba8b657a001c006ef606d6da678b125b3ce5f0..924c9d5e9451c90d501152bc61c5674633143da2 100644 (file)
@@ -961,8 +961,10 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
    }
 
    if (shProg->Uniforms->Parameters[location].Type == PROGRAM_SAMPLER) {
-      _slang_resolve_samplers(shProg, &shProg->VertexProgram->Base);
-      _slang_resolve_samplers(shProg, &shProg->FragmentProgram->Base);
+      if (shProg->VertexProgram)
+         _slang_resolve_samplers(shProg, &shProg->VertexProgram->Base);
+      if (shProg->FragmentProgram)
+         _slang_resolve_samplers(shProg, &shProg->FragmentProgram->Base);
       FLUSH_VERTICES(ctx, _NEW_TEXTURE);
    }
 }