diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/linker.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 3039232162a..4cec1077025 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -2625,6 +2625,13 @@ assign_attribute_or_color_locations(gl_shader_program *prog, continue; } + if (num_attr >= ARRAY_SIZE(to_assign)) { + linker_error(prog, "too many %s (max %u)", + target_index == MESA_SHADER_VERTEX ? + "vertex shader inputs" : "fragment shader outputs", + (unsigned)ARRAY_SIZE(to_assign)); + return false; + } to_assign[num_attr].slots = slots; to_assign[num_attr].var = var; num_attr++; |