Fix texenv segfault. Reported by Ben Skeggs.
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 10 May 2005 09:56:02 +0000 (09:56 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 10 May 2005 09:56:02 +0000 (09:56 +0000)
src/mesa/main/texenvprogram.c

index ede3df2a0b0123d3f93df641691f19a6bbf26017..1f9d7ae1c507dc4642b857704ac5ff5ae0f5beea 100644 (file)
@@ -705,6 +705,16 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
    p.program->NumTexIndirections = 1;  /* correct? */
    p.program->NumTexInstructions = 0;
    p.program->NumAluInstructions = 0;
+   p.program->Base.String = 0;
+   p.program->Base.NumInstructions =
+   p.program->Base.NumTemporaries =
+   p.program->Base.NumParameters =
+   p.program->Base.NumAttributes = p.program->Base.NumAddressRegs = 0;
+   if (p.program->Parameters)
+      _mesa_free_parameter_list(p.program->Parameters);
+   p.program->Parameters = _mesa_new_parameter_list();
+   p.program->InputsRead = 0;
+   p.program->OutputsWritten = 0;
 
    p.src_texture = undef;
    p.src_previous = undef;