diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-18 20:15:58 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-18 20:15:58 +0300 |
commit | 996152de58c4dcf45637d06a6f0b777db8e95147 (patch) | |
tree | d58101acfbe15547a49a23012ca8f7e6aaf29384 /source/blender/blenlib/intern/pbvh.c | |
parent | 7d19734add32150a13d408adc796c9287e551228 (diff) |
Bugfix: sculpt mode could crash using a mesh without faces.
Diffstat (limited to 'source/blender/blenlib/intern/pbvh.c')
-rw-r--r-- | source/blender/blenlib/intern/pbvh.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index ff68e3b0881..6f33fab2571 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -504,7 +504,8 @@ void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int BB_expand(&cb, bbc->bcentroid); } - pbvh_build(bvh, &cb, prim_bbc, totface); + if(totface) + pbvh_build(bvh, &cb, prim_bbc, totface); MEM_freeN(prim_bbc); MEM_freeN(bvh->vert_bitmap); @@ -544,7 +545,8 @@ void BLI_pbvh_build_grids(PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridad BB_expand(&cb, bbc->bcentroid); } - pbvh_build(bvh, &cb, prim_bbc, totgrid); + if(totgrid) + pbvh_build(bvh, &cb, prim_bbc, totgrid); MEM_freeN(prim_bbc); } |