Fix T55093: Bisect + fill crash
authorCampbell Barton <ideasman42@gmail.com>
Tue, 22 May 2018 15:22:29 +0000 (17:22 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 22 May 2018 15:23:25 +0000 (17:23 +0200)
source/blender/bmesh/operators/bmo_triangulate.c

index 2cdc26466493bd5f5bf14611c7e8ac209f161944..163a9ef599c169c777c47931a966ce3b9125e358 100644 (file)
@@ -252,7 +252,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
                BM_ITER_MESH_MUTABLE (e, e_next, &iter, bm, BM_EDGES_OF_MESH) {
                        if (BMO_edge_flag_test(bm, e, ELE_NEW)) {
                                /* in rare cases the edges face will have already been removed from the edge */
-                               if (LIKELY(e->l)) {
+                               if (LIKELY(BM_edge_is_manifold(e))) {
                                        BMFace *f_new = BM_faces_join_pair(bm, e->l, e->l->radial_next, false);
                                        if (f_new) {
                                                BMO_face_flag_enable(bm, f_new, ELE_NEW);
@@ -262,9 +262,13 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
                                                BMO_error_clear(bm);
                                        }
                                }
-                               else {
+                               else if (e->l == NULL) {
                                        BM_edge_kill(bm, e);
                                }
+                               else {
+                                       /* Edges with 1 or 3+ faces attached,
+                                        * most likely caused by a degeneratge mesh. */
+                               }
                        }
                }
        }