summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-03-05 09:49:00 -0700
committerBrian Paul <brianp@vmware.com>2009-03-05 09:49:27 -0700
commit6db24f449de9cc81e1f7bb2dde55a9819463d5e5 (patch)
tree8b80a70bde74e420be3a786016419a940f03e948 /src
parentdf8755edbedd6b0c85886db1b627f564c5a1beec (diff)
softpipe: added null ptr check for align_free() call in vbuf code
Fixes GALLIUM_NOCELL path. See bug 20475.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_vbuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
index eef6e5806c..e2b6a041b3 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;
}