diff options
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_convert.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_convert.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index 825963a2210..cfad5e1100d 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -545,10 +545,18 @@ Mesh *BKE_mesh_new_nomain_from_curve_displist(const Object *ob, const ListBase * mesh = BKE_mesh_new_nomain(totvert, totedge, 0, totloop, totpoly); mesh->runtime.cd_dirty_vert |= CD_MASK_NORMAL; - memcpy(mesh->mvert, allvert, totvert * sizeof(MVert)); - memcpy(mesh->medge, alledge, totedge * sizeof(MEdge)); - memcpy(mesh->mloop, allloop, totloop * sizeof(MLoop)); - memcpy(mesh->mpoly, allpoly, totpoly * sizeof(MPoly)); + if (totvert != 0) { + memcpy(mesh->mvert, allvert, totvert * sizeof(MVert)); + } + if (totedge != 0) { + memcpy(mesh->medge, alledge, totedge * sizeof(MEdge)); + } + if (totloop != 0) { + memcpy(mesh->mloop, allloop, totloop * sizeof(MLoop)); + } + if (totpoly != 0) { + memcpy(mesh->mpoly, allpoly, totpoly * sizeof(MPoly)); + } if (alluv) { const char *uvname = "UVMap"; |