diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-02-18 19:58:57 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-02-18 19:59:16 +0300 |
commit | 839a6b22d6c3750b0c8a98ccdb50d57e475ec754 (patch) | |
tree | f3e49d7597695176c9cfb0e9486797fed617e1ed /source/blender/modifiers/intern/MOD_mask.c | |
parent | c9fa37fbcd0af7196915fa17642b205024a6d249 (diff) |
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).
Diffstat (limited to 'source/blender/modifiers/intern/MOD_mask.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_mask.c | 7 |
1 files changed, 3 insertions, 4 deletions
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 */ |