From fca9121a21155701027b307897e508dc2e42bbc5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 26 Feb 2004 22:20:29 +0000 Subject: check for null paramList --- src/mesa/main/program.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/program.c b/src/mesa/main/program.c index 2fc52d9bd4..6c1e362322 100644 --- a/src/mesa/main/program.c +++ b/src/mesa/main/program.c @@ -389,6 +389,9 @@ _mesa_lookup_parameter_value(struct program_parameter_list *paramList, { GLuint i; + if (!paramList) + return NULL; + if (nameLen == -1) { /* name is null-terminated */ for (i = 0; i < paramList->NumParameters; i++) { @@ -418,6 +421,9 @@ _mesa_lookup_parameter_index(struct program_parameter_list *paramList, { GLint i; + if (!paramList) + return -1; + if (nameLen == -1) { /* name is null-terminated */ for (i = 0; i < (GLint) paramList->NumParameters; i++) { @@ -799,6 +805,10 @@ _mesa_load_state_parameters(GLcontext *ctx, struct program_parameter_list *paramList) { GLuint i; + + if (!paramList) + return; + for (i = 0; i < paramList->NumParameters; i++) { if (paramList->Parameters[i].Type == STATE) { _mesa_fetch_state(ctx, paramList->Parameters[i].StateIndexes, -- cgit v1.2.3