From: Yuanhan Liu Date: Mon, 19 Sep 2011 07:03:04 +0000 (+0800) Subject: mesa: fix error handling for glSelectBuffer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=57b8f13aa4dea6c8056f60574b0d4abccc2dbb49;p=mesa.git 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 --- 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 */