diff options
author | Joseph Eagar <joeedh@gmail.com> | 2011-12-04 04:44:09 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2011-12-04 04:44:09 +0400 |
commit | a115c02605b2692710f5d9b64d87407b7ca5b374 (patch) | |
tree | e246d8a4647cfb224f2737c7ef31dd35abfe77ee /source/blender | |
parent | 70ee57280416e6356559c46276a42c34b04bdfc9 (diff) |
bmesh: fixed crash in bevel
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/bmesh/bmesh_class.h | 1 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bevel.c | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index 36bb2a32d06..ddfdf775671 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -98,6 +98,7 @@ typedef struct BMLoop { int _index; /*used for sorting during tesselation*/ } BMLoop; +/*eventually, this structure will be used for supporting holes in faces*/ typedef struct BMLoopList { struct BMLoopList *next, *prev; struct BMLoop *first, *last; diff --git a/source/blender/bmesh/operators/bevel.c b/source/blender/bmesh/operators/bevel.c index 421306bdd9d..604c6abaa58 100644 --- a/source/blender/bmesh/operators/bevel.c +++ b/source/blender/bmesh/operators/bevel.c @@ -288,7 +288,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) } bm->elem_index_dirty |= BM_EDGE; - + BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) { BMIter eiter; @@ -563,9 +563,9 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) BMVert *vv, *vstart=NULL, *lastv=NULL; SmallHash tmphash; int rad, insorig=0, err=0; - + BLI_smallhash_init(&tmphash); - + if (!BMO_TestFlag(bm, v, BEVEL_FLAG)) continue; @@ -580,6 +580,9 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op) if (BM_Edge_FaceCount(e) < 2) insorig = 1; + if (BM_GetIndex(e) == -1) + continue; + rad = 0; BM_ITER(l, &liter, bm, BM_LOOPS_OF_EDGE, e) { if (!BMO_TestFlag(bm, l->f, FACE_OLD)) |