Mesa (master): mesa/es: Validate TexCoordPointer size in Mesa code rather than the ES wrapper

Ian Romanick idr at kemper.freedesktop.org
Sat Aug 25 02:15:07 UTC 2012


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Jul 25 15:13:51 2012 -0700

mesa/es: Validate TexCoordPointer size in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/APIspec.xml |    6 ------
 src/mesa/main/varray.c    |    3 ++-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml
index c08a82b..0316d4c 100644
--- a/src/mesa/main/APIspec.xml
+++ b/src/mesa/main/APIspec.xml
@@ -1339,12 +1339,6 @@
 		<param name="stride" type="GLsizei"/>
 		<param name="pointer" type="const GLvoid *"/>
 	</proto>
-
-	<desc name="size" error="GL_INVALID_VALUE">
-		<value name="2"/>
-		<value name="3"/>
-		<value name="4"/>
-	</desc>
 </template>
 
 <template name="VertexPointer">
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index aacc5c9..4269fd2 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -361,11 +361,12 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
          HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
          UNSIGNED_INT_2_10_10_10_REV_BIT |
          INT_2_10_10_10_REV_BIT);
+   const GLint sizeMin = (ctx->API == API_OPENGLES) ? 2 : 1;
    const GLuint unit = ctx->Array.ActiveTexture;
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
    update_array(ctx, "glTexCoordPointer", VERT_ATTRIB_TEX(unit),
-                legalTypes, 1, 4,
+                legalTypes, sizeMin, 4,
                 size, type, stride, GL_FALSE, GL_FALSE,
                 ptr);
 }




More information about the mesa-commit mailing list