From: Laura Ekstrand Date: Fri, 12 Dec 2014 19:02:02 +0000 (-0800) Subject: main: glDeleteTextures now throws GL_INVALID_VALUE if n is negative. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2546d901be3b47d8731ccfed5feb55afdab94763;p=mesa.git main: glDeleteTextures now throws GL_INVALID_VALUE if n is negative. This is in conformance with the OpenGL spec. Reviewed-by: Anuj Phogat --- diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 0ff271769e6..d6e44f24c8c 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -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;