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.
This commit is contained in:
Brian Paul 2012-10-05 16:59:27 -06:00
parent 32faf7ab0d
commit e75051d196

View file

@ -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;