From ee7e58e11140e18ebac8dd44f358aa151f1fa880 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Jun 2006 23:11:35 +0000 Subject: check for invalid mode in glBegin(), bug 7142 --- src/mesa/tnl/t_vtx_api.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/tnl/t_vtx_api.c') diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c index ed0688965b4..47652282696 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); -- cgit v1.2.3