Mesa (master): mesa: Returns a GL_INVALID_VALUE error if num of fbos in glDeleteFramebuffers is negative

Iago Toral Quiroga itoral at kemper.freedesktop.org
Tue Jan 13 11:20:27 UTC 2015


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

Author: Eduardo Lima Mitev <elima at igalia.com>
Date:   Thu Dec 11 23:34:17 2014 +0100

mesa: Returns a GL_INVALID_VALUE error if num of fbos in glDeleteFramebuffers is negative

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 at intel.com>

---

 src/mesa/main/fbobject.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index d3e941d..d0f19d0 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -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++) {




More information about the mesa-commit mailing list