summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Borca <[email protected]>2004-12-20 08:03:01 +0000
committerDaniel Borca <[email protected]>2004-12-20 08:03:01 +0000
commit2982dce27e242c89e4bc99979a878263df33ad2f (patch)
treeeca120615ed4cf55b99492f4bf503e5f70f4b732 /src
parent0d84c68313cba241b8020f12211f2abdfd53a955 (diff)
really protect against npot compressed textures (logbase2 never returns -1).
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/teximage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index a98771311d2..55d75116792 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2724,16 +2724,16 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions,
* XXX We should probably use the proxy texture error check function here.
*/
if (width < 1 || width > maxTextureSize ||
- (!ctx->Extensions.ARB_texture_non_power_of_two && logbase2(width) < 0))
+ (!ctx->Extensions.ARB_texture_non_power_of_two && _mesa_bitcount(width) != 1))
return GL_INVALID_VALUE;
if ((height < 1 || height > maxTextureSize ||
- (!ctx->Extensions.ARB_texture_non_power_of_two && logbase2(height) < 0))
+ (!ctx->Extensions.ARB_texture_non_power_of_two && _mesa_bitcount(height) != 1))
&& dimensions > 1)
return GL_INVALID_VALUE;
if ((depth < 1 || depth > maxTextureSize ||
- (!ctx->Extensions.ARB_texture_non_power_of_two && logbase2(depth) < 0))
+ (!ctx->Extensions.ARB_texture_non_power_of_two && _mesa_bitcount(depth) != 1))
&& dimensions > 2)
return GL_INVALID_VALUE;