From 6db24f449de9cc81e1f7bb2dde55a9819463d5e5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 5 Mar 2009 09:49:00 -0700 Subject: softpipe: added null ptr check for align_free() call in vbuf code Fixes GALLIUM_NOCELL path. See bug 20475. --- src/gallium/drivers/softpipe/sp_prim_vbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c index eef6e5806c9..e2b6a041b38 100644 --- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c +++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c @@ -90,7 +90,8 @@ sp_vbuf_allocate_vertices(struct vbuf_render *vbr, unsigned size = vertex_size * nr_vertices; if (cvbr->vertex_buffer_size < size) { - align_free(cvbr->vertex_buffer); + if (cvbr->vertex_buffer) + align_free(cvbr->vertex_buffer); cvbr->vertex_buffer = align_malloc(size, 16); cvbr->vertex_buffer_size = size; } -- cgit v1.2.3