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.)
This commit is contained in:
Nicholas Bishop 2012-04-04 16:35:13 +00:00
parent eefdeebae5
commit 84f3eb7786

@ -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;