diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-02 14:39:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-02 14:53:44 +0300 |
commit | 0f89d05848b8a279ac6507404dc535244cd73d43 (patch) | |
tree | 28837f4482db2ccf54eeffac636eaae7421b2f08 /source/blender/bmesh/operators | |
parent | 42a6b2fd06e4fefe1bdb283d9e568d7f7dca178e (diff) |
Fix T93563: Crash subdividing with overlapping tri and quad
The first loop was left out when finding the split edge boundary.
Error from f2138686d9d8c105ebf8884774fd7e4d8ff239a1.
Diffstat (limited to 'source/blender/bmesh/operators')
-rw-r--r-- | source/blender/bmesh/operators/bmo_subdivide.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index 7311c94a0d8..05837ae2a0e 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -1187,12 +1187,14 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) vlen = BLI_array_len(loops); /* find the boundary of one of the split edges */ - for (a = 1; a < vlen; a++) { - if (!BMO_vert_flag_test(bm, loops[a - 1]->v, ELE_INNER) && + for (a = 0; a < vlen; a++) { + if (!BMO_vert_flag_test(bm, loops[a ? (a - 1) : (vlen - 1)]->v, ELE_INNER) && BMO_vert_flag_test(bm, loops[a]->v, ELE_INNER)) { break; } } + /* Failure to break means there is an internal error. */ + BLI_assert(a < vlen); if (BMO_vert_flag_test(bm, loops[(a + numcuts + 1) % vlen]->v, ELE_INNER)) { b = (a + numcuts + 1) % vlen; |