diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-04-04 20:35:13 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-04-04 20:35:13 +0400 |
commit | 84f3eb77867569318e80c27645970dc7e8454870 (patch) | |
tree | 51f6868aa8885b8077e7da342eb9e9950a2178da | |
parent | eefdeebae5bae388054529d1e42615d73ef4a2de (diff) |
Fix bug [#30810] Blender crashes with Array modifier
When merging bmesh customdata, memset the new blocks to
zero. Otherwise can contain junk values (some layer types with
pointers like MDeformVert can then crash.)
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 638ba2ddc4d..c1d0a1674da 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -2251,8 +2251,11 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest, const LayerTypeInfo *typeInfo; int dest_i, src_i; - if (!*dest_block) + if (!*dest_block) { CustomData_bmesh_alloc_block(dest, dest_block); + if (*dest_block) + memset(*dest_block, 0, dest->totsize); + } /* copies a layer at a time */ dest_i = 0; |