From: Brian Date: Tue, 19 Dec 2006 16:52:07 +0000 (-0700) Subject: check for null Parameters ptr in _mesa_clone_program() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e76f0a846b8273843dca701543f1cba70284751;p=mesa.git check for null Parameters ptr in _mesa_clone_program() --- diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index c504c7c5c54..351427365cd 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -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;