diff options
author | Brian <[email protected]> | 2006-12-19 09:52:07 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2006-12-19 09:52:07 -0700 |
commit | 2e76f0a846b8273843dca701543f1cba70284751 (patch) | |
tree | c5d0900f88580926dbd8aad27ba6b9fd91727172 /src/mesa | |
parent | af1d46b68acb2e272b06177f2bdb50bf81553018 (diff) |
check for null Parameters ptr in _mesa_clone_program()
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/shader/program.c | 6 |
1 files 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; |