From: Brian Date: Mon, 5 Nov 2007 21:41:18 +0000 (-0700) Subject: Check for NULL VB->EdgeFlag array. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c9ce3e8fd2a8db93c833bfd9a06d31843145657b;p=mesa.git Check for NULL VB->EdgeFlag array. There might be a bug elsewhere, but this is a simple work-around for now. See bug 12614 --- diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index f6b738d60df..7d1bc234650 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -238,14 +238,16 @@ static void TAG(quadfunc)( GLcontext *ctx, GLuint v0, { if (IND & SS_UNFILLED_BIT) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte ef1 = VB->EdgeFlag[v1]; - GLubyte ef3 = VB->EdgeFlag[v3]; - VB->EdgeFlag[v1] = 0; - TAG(triangle)( ctx, v0, v1, v3 ); - VB->EdgeFlag[v1] = ef1; - VB->EdgeFlag[v3] = 0; - TAG(triangle)( ctx, v1, v2, v3 ); - VB->EdgeFlag[v3] = ef3; + if (VB->EdgeFlag) { /* XXX this test shouldn't be needed (bug 12614) */ + GLubyte ef1 = VB->EdgeFlag[v1]; + GLubyte ef3 = VB->EdgeFlag[v3]; + VB->EdgeFlag[v1] = 0; + TAG(triangle)( ctx, v0, v1, v3 ); + VB->EdgeFlag[v1] = ef1; + VB->EdgeFlag[v3] = 0; + TAG(triangle)( ctx, v1, v2, v3 ); + VB->EdgeFlag[v3] = ef3; + } } else { TAG(triangle)( ctx, v0, v1, v3 ); TAG(triangle)( ctx, v1, v2, v3 );