check for null Parameters ptr in _mesa_clone_program()
authorBrian <brian@yutani.localnet.net>
Tue, 19 Dec 2006 16:52:07 +0000 (09:52 -0700)
committerBrian <brian@yutani.localnet.net>
Tue, 19 Dec 2006 16:52:07 +0000 (09:52 -0700)
src/mesa/shader/program.c

index c504c7c5c54325ecfaf699899b5cf80f1789d19e..351427365cd1cd147ed1db5c6f56778efed3aae8 100644 (file)
@@ -358,9 +358,11 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog)
           prog->NumInstructions * sizeof(struct prog_instruction));
    clone->InputsRead = prog->InputsRead;
    clone->OutputsWritten = prog->OutputsWritten;
-   clone->Parameters = _mesa_clone_parameter_list(prog->Parameters);
+   if (prog->Parameters)
+      clone->Parameters = _mesa_clone_parameter_list(prog->Parameters);
    memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
-   clone->Varying = _mesa_clone_parameter_list(prog->Varying);
+   if (prog->Varying)
+      clone->Varying = _mesa_clone_parameter_list(prog->Varying);
    memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
    clone->NumInstructions = prog->NumInstructions;
    clone->NumTemporaries = prog->NumTemporaries;