From f84135ee655fa38b0a1347ef1e3139d938790a65 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 1 May 2015 16:11:55 +0200 Subject: Fix T44577: writing tessellated cddata when we should not... Own mistake in rBf75c89b3f42ffac51603e6e53459f9d94a8782cc... --- source/blender/blenloader/intern/writefile.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender') diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 39096abf5fa..285c50a4049 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2008,7 +2008,9 @@ static void write_meshes(WriteData *wd, ListBase *idbase) * If we do not do that, we can get crash by buffer-overflow on reading, see T44461. */ CustomData_copy(&old_mesh->vdata, &mesh->vdata, CD_MASK_EVERYTHING, CD_REFERENCE, mesh->totvert); CustomData_copy(&old_mesh->edata, &mesh->edata, CD_MASK_EVERYTHING, CD_REFERENCE, mesh->totedge); +#ifndef USE_BMESH_SAVE_WITHOUT_MFACE /* Do not copy org fdata in this case!!! */ CustomData_copy(&old_mesh->fdata, &mesh->fdata, CD_MASK_EVERYTHING, CD_REFERENCE, mesh->totface); +#endif CustomData_copy(&old_mesh->ldata, &mesh->ldata, CD_MASK_EVERYTHING, CD_REFERENCE, mesh->totloop); CustomData_copy(&old_mesh->pdata, &mesh->pdata, CD_MASK_EVERYTHING, CD_REFERENCE, mesh->totpoly); @@ -2030,7 +2032,9 @@ static void write_meshes(WriteData *wd, ListBase *idbase) CustomData_free(&mesh->vdata, mesh->totvert); CustomData_free(&mesh->edata, mesh->totedge); +#ifndef USE_BMESH_SAVE_WITHOUT_MFACE CustomData_free(&mesh->fdata, mesh->totface); +#endif CustomData_free(&mesh->ldata, mesh->totloop); CustomData_free(&mesh->pdata, mesh->totpoly); -- cgit v1.2.3