From: Brian Paul Date: Thu, 24 Apr 2008 22:40:08 +0000 (-0600) Subject: gallium: fix an edgeflags crash X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b4c7a48d5c9ed2f9535a17d6c05cd55178c7880a;p=mesa.git gallium: fix an edgeflags crash --- 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;