summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-06-08 23:11:35 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-06-08 23:11:35 +0000
commitee7e58e11140e18ebac8dd44f358aa151f1fa880 (patch)
tree5f8bba3d58cb93c35586d08d8615ca25c7c64965
parenta0daa1220fb9f0a4963565f3851ebb620efa222f (diff)
check for invalid mode in glBegin(), bug 7142
-rw-r--r--src/mesa/tnl/t_vtx_api.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index ed0688965b..4765228269 100644
--- a/src/mesa/tnl/t_vtx_api.c
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -740,6 +740,11 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT( ctx );
+ if (mode > GL_POLYGON) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBegin(mode)");
+ return;
+ }
+
if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) {
/* we're not inside a glBegin/End pair */
TNLcontext *tnl = TNL_CONTEXT(ctx);