summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorEduardo Lima Mitev <[email protected]>2014-12-11 23:34:20 +0100
committerIago Toral Quiroga <[email protected]>2015-01-13 12:19:32 +0100
commit038894c7cb8fd71fc7e5b6e4b64a93cb8613adb3 (patch)
treed2c7a44671f968d197e2fd090c9950028f8d75ba /src/mesa/main/texobj.c
parent2012f62d4abb6633b5329235194d23692f86b17b (diff)
mesa: Returns a GL_INVALID_VALUE error if num of texs in glDeleteTextures is negative
Per GLES3 manual for glDeleteTextures <https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteTextures.xhtml>, GL_INVALID_VALUE is generated if n is negative. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.texture.deletetextures Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 6e5eb7398f1..a99dd7ad7c7 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1406,6 +1406,11 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glDeleteTextures %d\n", n);
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteTextures(n < 0)");
+ return;
+ }
+
FLUSH_VERTICES(ctx, 0); /* too complex */
if (n < 0) {