summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorYuanhan Liu <[email protected]>2011-09-19 15:03:04 +0800
committerBrian Paul <[email protected]>2011-09-19 08:11:52 -0600
commit57b8f13aa4dea6c8056f60574b0d4abccc2dbb49 (patch)
treec3e564b484035a07d605dc012dc8b08848109180 /src/mesa/main
parent7a9a8bbabd27b8475b541cbdb2b43f75e23dbf4c (diff)
mesa: fix error handling for glSelectBuffer
According the man page, trigger a GL_INVALID_VALUE if size < 0. Signed-off-by: Yuanhan Liu <[email protected]> Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/feedback.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
index 597ec1e3f9a..d73aa08fa3d 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 */