summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_arrayelt.c
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2006-01-19 18:00:38 +0000
committerAdam Jackson <[email protected]>2006-01-19 18:00:38 +0000
commit37e86254c12c7d7ab844ad772360b7c6bb25b209 (patch)
tree8a9d846d8dbb55783066ae97b1381d36def978e5 /src/mesa/main/api_arrayelt.c
parent216f729a9559136c404f83078127876b9810e295 (diff)
Avoid a crash when the user has enabled glVertex{,Attrib}Pointer but hasn't
filled in a valid pointer for that attribute or vertex array.
Diffstat (limited to 'src/mesa/main/api_arrayelt.c')
-rw-r--r--src/mesa/main/api_arrayelt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 84df98dc89b..e22f4bb75d6 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -699,7 +699,7 @@ static void _ae_update_state( GLcontext *ctx )
aa++;
}
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
- if (ctx->Array.TexCoord[i].Enabled) {
+ if (ctx->Array.TexCoord[i].Enabled && ctx->Array.TexCoord[i].Ptr) {
/* NOTE: we use generic glVertexAttrib functions here.
* If we ever de-alias conventional/generic vertex attribs this
* will have to change.
@@ -714,7 +714,8 @@ static void _ae_update_state( GLcontext *ctx )
/* generic vertex attribute arrays */
for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */
- if (ctx->Array.VertexAttrib[i].Enabled) {
+ if (ctx->Array.VertexAttrib[i].Enabled &&
+ ctx->Array.VertexAttrib[i].Ptr) {
struct gl_client_array *attribArray = &ctx->Array.VertexAttrib[i];
at->array = attribArray;
/* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV