From 57b8f13aa4dea6c8056f60574b0d4abccc2dbb49 Mon Sep 17 00:00:00 2001 From: Yuanhan Liu Date: Mon, 19 Sep 2011 15:03:04 +0800 Subject: mesa: fix error handling for glSelectBuffer According the man page, trigger a GL_INVALID_VALUE if size < 0. Signed-off-by: Yuanhan Liu Signed-off-by: Brian Paul --- src/mesa/main/feedback.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/main') 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 */ -- cgit v1.2.3