aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/feedback.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/feedback.c')
-rw-r--r--mesalib/src/mesa/main/feedback.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/feedback.c b/mesalib/src/mesa/main/feedback.c
index 597ec1e3f..d73aa08fa 100644
--- a/mesalib/src/mesa/main/feedback.c
+++ b/mesalib/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 */