From: Eduardo Lima Mitev Date: Thu, 11 Dec 2014 22:34:17 +0000 (+0100) Subject: mesa: Returns a GL_INVALID_VALUE error if num of fbos in glDeleteFramebuffers is... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f77a473497dad587afb97ea4fda8c13495f5fe69;p=mesa.git mesa: Returns a GL_INVALID_VALUE error if num of fbos in glDeleteFramebuffers is negative Per GLES3 manual for glDeleteFramebuffers , 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 --- diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index d3e941d7f8a..d0f19d01573 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++) {