mesa: Returns a GL_INVALID_VALUE error if num of fbos in glDeleteFramebuffers is...
authorEduardo Lima Mitev <elima@igalia.com>
Thu, 11 Dec 2014 22:34:17 +0000 (23:34 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 13 Jan 2015 11:19:32 +0000 (12:19 +0100)
Per GLES3 manual for glDeleteFramebuffers
<https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteFramebuffers.xhtml>,
GL_INVALID_VALUE is generated if n is negative.

Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.buffer.delete_framebuffers

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/fbobject.c

index d3e941d7f8a65aec5c475e4b0620a40a619b6622..d0f19d0157304d4c52203509993a668280893bde 100644 (file)
@@ -2203,6 +2203,11 @@ _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
    GLint i;
    GET_CURRENT_CONTEXT(ctx);
 
+   if (n < 0) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteFramebuffers(n < 0)");
+      return;
+   }
+
    FLUSH_VERTICES(ctx, _NEW_BUFFERS);
 
    for (i = 0; i < n; i++) {