diff options
author | Brian Paul <[email protected]> | 2008-04-24 16:40:08 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-04-24 16:40:08 -0600 |
commit | b4c7a48d5c9ed2f9535a17d6c05cd55178c7880a (patch) | |
tree | 8bfedb2575c8d513e8563907bd7b9ddd0e327e5a /src | |
parent | 2926e59e4ad604dedcb639b2961937841afcf005 (diff) |
gallium: fix an edgeflags crash
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 097166f4446..e40eeddff55 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -208,10 +208,14 @@ setup_edgeflags(GLcontext *ctx, GLenum primMode, GLint start, GLint count, ctx->Polygon.BackMode != GL_FILL)) { /* need edge flags */ GLuint i; - unsigned *vec = (unsigned *) calloc(sizeof(unsigned), (count + 31) / 32); + unsigned *vec; struct st_buffer_object *stobj = st_buffer_object(array->BufferObj); ubyte *map; + if (!stobj) + return NULL; + + vec = (unsigned *) calloc(sizeof(unsigned), (count + 31) / 32); if (!vec) return NULL; |