From: Dave Airlie <airl...@redhat.com> This fixes: GL45-CTS.explicit_uniform_location.subroutine-index-negative-link-max-num-of-indices
Signed-off-by: Dave Airlie <airl...@redhat.com> --- src/compiler/glsl/linker.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index ef8db56..4c567fc 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -4229,6 +4229,10 @@ link_assign_subroutine_types(struct gl_shader_program *prog) if (!fn->num_subroutine_types) continue; + if (sh->NumSubroutineFunctions + 1 > MAX_SUBROUTINES) { + linker_error(prog, "Too many subroutine functions declared.\n"); + return; + } sh->SubroutineFunctions = reralloc(sh, sh->SubroutineFunctions, struct gl_subroutine_function, sh->NumSubroutineFunctions + 1); -- 2.5.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev