From 839a6b22d6c3750b0c8a98ccdb50d57e475ec754 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Wed, 18 Feb 2015 17:58:57 +0100 Subject: Fix T43716 regression in mask modifier - edges could access out of bounds indices of vertices. Issue here is that if we copy edge customdata the MEdge data that were previously written get overwritten, solution is to write indices and flags last (probably writing flags is superfluous here). --- source/blender/modifiers/intern/MOD_mask.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index 59348c5a5ae..c1d4e41c19f 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -293,7 +293,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, mloop_dst = CDDM_get_loops(result); medge_dst = CDDM_get_edges(result); mvert_dst = CDDM_get_verts(result); - + /* using ghash-iterators, map data into new mesh */ /* vertices */ GHASH_ITER (gh_iter, vertHash) { @@ -318,12 +318,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, e_src = &medge_src[i_src]; e_dst = &medge_dst[i_dst]; - + + DM_copy_edge_data(dm, result, i_src, i_dst, 1); *e_dst = *e_src; e_dst->v1 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src->v1))); e_dst->v2 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src->v2))); - - DM_copy_edge_data(dm, result, i_src, i_dst, 1); } /* faces */ -- cgit v1.2.3