[Mesa-dev] [PATCH] mesa: check width and height in copyteximage

2013-03-03 Thread Marek Olšák
This WebGL test sets width and height to 0:
https://www.khronos.org/registry/webgl/sdk/tests/conformance/misc/type-conversion-test.html

It causes assertion failures in the state tracker.
---
 src/mesa/main/teximage.c |4 
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 0dcf88a..7ec5fdb 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -3453,6 +3453,10 @@ copyteximage(struct gl_context *ctx, GLuint dims,
   return;
}
 
+   if (!width || !height) {
+  return; /* undefined behavior? */
+   }
+
texObj = _mesa_get_current_tex_object(ctx, target);
assert(texObj);
 
-- 
1.7.10.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: check width and height in copyteximage

2013-03-03 Thread Eric Anholt
Marek Olšák mar...@gmail.com writes:

 This WebGL test sets width and height to 0:
 https://www.khronos.org/registry/webgl/sdk/tests/conformance/misc/type-conversion-test.html

I don't see it being undefined, it just inherits behavior from teximage:

CopyTexImage2D... defines a two-dimensional texture array in exactly
the manner of TexImage2D, except that the image data are taken from the
framebuffer rather than from client memory.


pgpzUGCEGlkgK.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev