Mesa (7.11): mesa: fix error handling for glSelectBuffer

Ian Romanick idr at kemper.freedesktop.org
Mon Oct 24 15:54:48 PDT 2011


Module: Mesa
Branch: 7.11
Commit: 2af0708c85b203a984ee231506583b6c77238a8f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2af0708c85b203a984ee231506583b6c77238a8f

Author: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Date:   Mon Sep 19 15:03:04 2011 +0800

mesa: fix error handling for glSelectBuffer

According the man page, trigger a GL_INVALID_VALUE if size < 0.

Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Signed-off-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit 57b8f13aa4dea6c8056f60574b0d4abccc2dbb49)

---

 src/mesa/main/feedback.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
index fcb089f..f9c4b5f 100644
--- a/src/mesa/main/feedback.c
+++ b/src/mesa/main/feedback.c
@@ -168,6 +168,11 @@ _mesa_SelectBuffer( GLsizei size, GLuint *buffer )
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
+   if (size < 0) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glSelectBuffer(size)");
+      return;
+   }
+
    if (ctx->RenderMode==GL_SELECT) {
       _mesa_error( ctx, GL_INVALID_OPERATION, "glSelectBuffer" );
       return;			/* KW: added return */



More information about the mesa-commit mailing list