summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-02-26 22:20:29 +0000
committerBrian Paul <[email protected]>2004-02-26 22:20:29 +0000
commitfca9121a21155701027b307897e508dc2e42bbc5 (patch)
tree230dab54908ea17911c265811be7719bff663610
parente6149fac64da1653a315687465a1d83bd8373612 (diff)
check for null paramList
-rw-r--r--src/mesa/main/program.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/program.c b/src/mesa/main/program.c
index 2fc52d9bd4a..6c1e3623221 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,