This fixes:
GL45-CTS.explicit_uniform_location.subroutine-index-negative-link-max-num-of-indices
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
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);