diff options
author | Brian Paul <brianp@vmware.com> | 2012-10-05 16:59:27 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2012-10-09 07:47:43 -0600 |
commit | e75051d1967350ceff0209dde24ae42696b13b5c (patch) | |
tree | e3824df7d4a2a1d7564ba72e2f5da8cdf34c15b1 | |
parent | 32faf7ab0de8b88bb15a2cb262a73c411dce9d0d (diff) |
mesa: fix error check for zero-sized compressed subtexture
For glCompressedTexSubImage, width or height = 0 is legal.
Fixes a failure in piglit's s3tc-errors test.
This is for the 9.0 and 8.0 branches. Already fixed on master.
-rw-r--r-- | src/mesa/main/teximage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 80048766e56..38fa9fae705 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3598,10 +3598,10 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dimensions, if (!_mesa_is_compressed_format(ctx, format)) return GL_INVALID_ENUM; - if (width < 1 || width > maxTextureSize) + if (width < 0 || width > maxTextureSize) return GL_INVALID_VALUE; - if ((height < 1 || height > maxTextureSize) + if ((height < 0 || height > maxTextureSize) && dimensions > 1) return GL_INVALID_VALUE; |