diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-26 07:20:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-26 07:20:10 +0400 |
commit | 98f7f73644ad04503c58d363ba27ad430c851e85 (patch) | |
tree | ab90cf03bf784230004bc5b098d9dc326a6b435e /source/blender/editors | |
parent | 10f2ad1663ca5b041a850305a442e8cbf84cefab (diff) |
fix [#34415] Edge slide results in segmentation fault on certain mesh
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index ea82ebb9234..53142243f4f 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -5285,6 +5285,7 @@ static int createEdgeSlideVerts(TransInfo *t) TransDataEdgeSlideVert *sv; /* XXX, 'sv' will initialize multiple times, this is suspicious. see [#34024] */ + BLI_assert(BLI_smallhash_haskey(&table, (uintptr_t)v) != false); sv = sv_array + GET_INT_FROM_POINTER(BLI_smallhash_lookup(&table, (uintptr_t)v)); sv->v = v; sv->origvert = *v; @@ -5307,6 +5308,7 @@ static int createEdgeSlideVerts(TransInfo *t) e1 = e; e = get_other_edge(v, e); if (!e) { + BLI_assert(BLI_smallhash_haskey(&table, (uintptr_t)v) != false); sv = sv_array + GET_INT_FROM_POINTER(BLI_smallhash_lookup(&table, (uintptr_t)v)); sv->v = v; sv->origvert = *v; @@ -5331,6 +5333,12 @@ static int createEdgeSlideVerts(TransInfo *t) l1 = get_next_loop(v, l1, e1, e, vec); l2 = l2 ? get_next_loop(v, l2, e1, e, vec2) : NULL; + if (UNLIKELY(l1 == NULL && l2 != NULL)) { + l1 = l2; + l2 = NULL; + swap_v3_v3(vec, vec2); + } + BM_elem_flag_disable(v, BM_ELEM_TAG); BM_elem_flag_disable(v2, BM_ELEM_TAG); } while (e != v_first->e && l1); @@ -5372,6 +5380,7 @@ static int createEdgeSlideVerts(TransInfo *t) continue; } + BLI_assert(BLI_smallhash_haskey(&table, (uintptr_t)v) != false); j = GET_INT_FROM_POINTER(BLI_smallhash_lookup(&table, (uintptr_t)v)); if (sv_array[j].down) { |