summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compiler/glsl/link_varyings.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 69c92bf53b0..cb9091d86b4 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -556,6 +556,13 @@ cross_validate_outputs_to_inputs(struct gl_context *ctx,
unsigned slot_limit = idx + num_elements;
while (idx < slot_limit) {
+ if (idx >= MAX_VARYING) {
+ linker_error(prog,
+ "Invalid location %u in %s shader\n", idx,
+ _mesa_shader_stage_to_string(consumer->Stage));
+ return;
+ }
+
output = explicit_locations[idx][input->data.location_frac];
if (output == NULL ||