diff options
author | Oliver McFadden <z3ro.geek@gmail.com> | 2007-05-09 14:23:22 +0000 |
---|---|---|
committer | Oliver McFadden <z3ro.geek@gmail.com> | 2007-05-09 14:23:22 +0000 |
commit | f9828f5c4f75683934536482a7eb9b7ef2758700 (patch) | |
tree | 51f23ec9f9949594406275eced032b9c82f3efaf /src/mesa/shader | |
parent | 7b165de5f8a4c3d99b8b9f1820e12d5899b3884f (diff) | |
parent | 62ef001de7c16aff459114c1dcc8097270689e6d (diff) |
Merge branch 'master' of git://anongit.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/shader_api.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 64f2a9fa12..3a54e68d0d 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.0 * * Copyright (C) 2004-2007 Brian Paul All Rights Reserved. * @@ -1072,12 +1072,20 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, * If we're setting a sampler, we must use glUniformi1()! */ if (shProg->Uniforms->Parameters[location].Type == PROGRAM_SAMPLER) { + GLint unit; if (type != GL_INT || count != 1) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(only glUniform1i can be used " "to set sampler uniforms)"); return; } + /* check that the sampler (tex unit index) is legal */ + unit = ((GLint *) values)[0]; + if (unit >= ctx->Const.MaxTextureImageUnits) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glUniform1(invalid sampler/tex unit index)"); + return; + } } if (count < 0) { |