diff options
author | Dave Airlie <[email protected]> | 2015-07-28 07:11:06 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-05-23 16:18:25 +1000 |
commit | ba3414d832c0661e6b827641dbd33a2829d1812e (patch) | |
tree | 8623dcef62af18d1de5ecfd3f99cbdb42dd24bdb /src/mesa/main/shaderapi.c | |
parent | 74e71cbfcb2950d0aa59e5b05ab817e93dfad4ee (diff) |
arb_shader_subroutine: check active subroutine limit
_mesa_GetActiveSubroutineUniformiv needs to check
against the number of types here.
Noticed while playing with ogl conform.
Reviewed-by: Chris Forbes <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r-- | src/mesa/main/shaderapi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 3c85b41c88c..109171ef57a 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -2369,6 +2369,11 @@ _mesa_GetActiveSubroutineUniformiv(GLuint program, GLenum shadertype, return; } + if (index >= sh->NumSubroutineUniformTypes) { + _mesa_error(ctx, GL_INVALID_VALUE, "%s: invalid index greater than GL_ACTIVE_SUBROUTINE_UNIFORMS", api_name); + return; + } + switch (pname) { case GL_NUM_COMPATIBLE_SUBROUTINES: { res = _mesa_program_resource_find_index(shProg, resource_type, index); |