Mesa (9.0): mesa: fix error check for zero-sized compressed subtexture

Brian Paul brianp at kemper.freedesktop.org
Tue Oct 9 13:48:01 UTC 2012


Module: Mesa
Branch: 9.0
Commit: e75051d1967350ceff0209dde24ae42696b13b5c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e75051d1967350ceff0209dde24ae42696b13b5c

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Oct  5 16:59:27 2012 -0600

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.

---

 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 8004876..38fa9fa 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;
 




More information about the mesa-commit mailing list