diff options
author | Alan Hourihane <[email protected]> | 2002-12-30 19:24:05 +0000 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2002-12-30 19:24:05 +0000 |
commit | 95249b2d189de093ff4a19af3f27efe4ad3e82cd (patch) | |
tree | 87f69c0f0d720c8ab5e700e2d48a954da09e61b5 /src/mesa/main/texstate.c | |
parent | 0070285b32e06a1b33b96af30bdf96d0e1ef3a84 (diff) |
Check that ActiveTextureARB doesn't overflow MaxTextureUnits
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r-- | src/mesa/main/texstate.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 91e7ad96420..d234b176813 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.89 2002/12/18 15:01:26 brianp Exp $ */ +/* $Id: texstate.c,v 1.90 2002/12/30 19:24:05 alanh Exp $ */ /* * Mesa 3-D graphics library @@ -2427,7 +2427,8 @@ _mesa_ActiveTextureARB( GLenum target ) _mesa_debug(ctx, "glActiveTexture %s\n", _mesa_lookup_enum_by_nr(target)); - if (texUnit > ctx->Const.MaxTextureUnits) { + /* Cater for texture unit 0 is first, therefore use >= */ + if (texUnit >= ctx->Const.MaxTextureUnits) { _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTextureARB(target)"); return; } |