summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/glsl/loop_controls.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glsl/loop_controls.cpp b/src/glsl/loop_controls.cpp
index 2ef3d30..b528810 100644
--- a/src/glsl/loop_controls.cpp
+++ b/src/glsl/loop_controls.cpp
@@ -85,6 +85,9 @@ int
calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
enum ir_expression_operation op)
{
+ if (from == NULL || to == NULL || increment == NULL)
+ return -1;
+
void *mem_ctx = talloc_init("%s", __func__);
ir_expression *const sub =