[Bf-blender-cvs] [4f4cea727ef] master: Fix T63164: DNA size mismatches on 32bit, causing memory corruption and crashes.

Brecht Van Lommel noreply at git.blender.org
Tue Apr 2 16:01:29 CEST 2019


Commit: 4f4cea727efdeaf388de7ce84a6a6c399050c590
Author: Brecht Van Lommel
Date:   Tue Apr 2 15:56:16 2019 +0200
Branches: master
https://developer.blender.org/rB4f4cea727efdeaf388de7ce84a6a6c399050c590

Fix T63164: DNA size mismatches on 32bit, causing memory corruption and crashes.

Some alignment rules from Visual Studion on 32 bit are not taken into
account, this fixes the structs to confirm. We now have static asserts
to catch when such breakage happens in the future.

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

M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesdna/DNA_mesh_types.h
M	source/blender/makesdna/DNA_object_types.h

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

diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index bd17d4e57dc..56e17fe9149 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -201,6 +201,7 @@ typedef struct bGPDstroke {
 
 	/** Vertex weight data. */
 	struct MDeformVert *dvert;
+	void *_pad3;
 
 	bGPDstroke_Runtime runtime;
 	char _pad2[4];
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 15b95104359..0d43b14e252 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -189,6 +189,7 @@ typedef struct Mesh {
 
 	/** Deprecated multiresolution modeling data, only keep for loading old files. */
 	struct Multires *mr DNA_DEPRECATED;
+	void *_pad1;
 
 	Mesh_Runtime runtime;
 } Mesh;
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index e97ae722457..9f2118d9cc0 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -170,6 +170,7 @@ typedef struct Object_Runtime {
 
 	struct ObjectBBoneDeform *cached_bbone_deformation;
 
+	void *_pad1;
 } Object_Runtime;
 
 typedef struct Object {



More information about the Bf-blender-cvs mailing list