From 2e76f0a846b8273843dca701543f1cba70284751 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 19 Dec 2006 09:52:07 -0700 Subject: [PATCH] check for null Parameters ptr in _mesa_clone_program() --- src/mesa/shader/program.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.30.2