OSDN Git Service

main: glDeleteTextures now throws GL_INVALID_VALUE if n is negative.
authorLaura Ekstrand <laura@jlekstrand.net>
Fri, 12 Dec 2014 19:02:02 +0000 (11:02 -0800)
committerLaura Ekstrand <laura@jlekstrand.net>
Thu, 8 Jan 2015 19:37:30 +0000 (11:37 -0800)
This is in conformance with the OpenGL spec.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/texobj.c

index 0ff2717..d6e44f2 100644 (file)
@@ -1403,6 +1403,11 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
 
    FLUSH_VERTICES(ctx, 0); /* too complex */
 
+   if (n < 0) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteTextures(n)");
+      return;
+   }
+
    if (!textures)
       return;