summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_vtx_api.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-02-26 22:09:28 +0000
committerBrian Paul <[email protected]>2004-02-26 22:09:28 +0000
commit1ef3d3a7589eeabf0229cb3c6a9419d0eef2a681 (patch)
tree5fbc889318de7fdc5102c599558b4052c8fcb842 /src/mesa/tnl/t_vtx_api.c
parent04207ab7e2bd6be14ea946de7f741490a7194a95 (diff)
check for invalid vertex/fragment program in glBegin
Diffstat (limited to 'src/mesa/tnl/t_vtx_api.c')
-rw-r--r--src/mesa/tnl/t_vtx_api.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index b69a1a612e1..a9a1c5bd5f8 100644
--- a/src/mesa/tnl/t_vtx_api.c
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -992,6 +992,15 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT( ctx );
+ if ((ctx->VertexProgram.Enabled
+ && !ctx->VertexProgram.Current->Instructions) ||
+ (ctx->FragmentProgram.Enabled
+ && !ctx->FragmentProgram.Current->Instructions)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBegin (invalid vertex/fragment program)");
+ return;
+ }
+
if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) {
TNLcontext *tnl = TNL_CONTEXT(ctx);
int i;