summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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,