summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-08-18 12:52:56 +0200
committerKenneth Graunke <[email protected]>2010-08-20 13:01:07 -0700
commitfc76d7276393a4617f9898214bc397bb65634b02 (patch)
tree7f7b6a4be73743c2df7984897aed7332b1b75a16 /src/mesa/program
parentc108a7927d1dad9e0f641a0ec5a7387fb2626156 (diff)
glsl: don't crash if a field is specified for a non-struct uniform
This was triggered by the previous bug, but is a separate problem in the general sense.
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 1fbf574bc8b..fe2d8982d0b 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -1145,7 +1145,7 @@ get_builtin_uniform_reg(struct gl_program *prog,
if (!field && statevars[i].field) {
assert(!"FINISHME: whole-structure state var dereference");
}
- if (field && strcmp(statevars[i].field, field) != 0)
+ if (field && (!statevars[i].field || strcmp(statevars[i].field, field) != 0))
continue;
break;
}