[Bf-blender-cvs] [f84135e] master: Fix T44577: writing tessellated cddata when we should not...

Bastien Montagne noreply at git.blender.org
Fri May 1 16:13:37 CEST 2015


Commit: f84135ee655fa38b0a1347ef1e3139d938790a65
Author: Bastien Montagne
Date:   Fri May 1 16:11:55 2015 +0200
Branches: master
https://developer.blender.org/rBf84135ee655fa38b0a1347ef1e3139d938790a65

Fix T44577: writing tessellated cddata when we should not...

Own mistake in rBf75c89b3f42ffac51603e6e53459f9d94a8782cc...

===================================================================

M	source/blender/blenloader/intern/writefile.c

===================================================================

diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 39096ab..285c50a 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);




More information about the Bf-blender-cvs mailing list