[Bf-blender-cvs] [53753c0] master: Fix T37488: Crash with --debug reading userpref.blend

Sergey Sharybin noreply at git.blender.org
Mon Nov 18 13:16:51 CET 2013


Commit: 53753c0ddc947aa74246492fb76466198a28db58
Author: Sergey Sharybin
Date:   Mon Nov 18 18:13:23 2013 +0600
http://developer.blender.org/rB53753c0ddc947aa74246492fb76466198a28db58

Fix T37488: Crash with --debug reading userpref.blend

Issue was in fact caused by wrong DNA storage, which
apparently was considering unsigned long as just 4
bytes here.

Now use uint64_t to be sure timestamp does fit into
storage on all the platforms.

Thanks Campbell for help looking in the issue.

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

M	source/blender/blenkernel/BKE_main.h
M	source/blender/makesdna/DNA_fileglobal_types.h
M	source/gameengine/Ketsji/KX_PythonMain.h

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

diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index 629eda3..7b7b690 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -53,7 +53,7 @@ typedef struct Main {
 	char name[1024]; /* 1024 = FILE_MAX */
 	short versionfile, subversionfile;  /* see BLENDER_VERSION, BLENDER_SUBVERSION */
 	short minversionfile, minsubversionfile;
-	unsigned long build_commit_timestamp; /* commit's timestamp from buildinfo */
+	uint64_t build_commit_timestamp; /* commit's timestamp from buildinfo */
 	char build_hash[16];  /* hash from buildinfo */
 	short recovered;	/* indicate the main->name (file) is the recovered one */
 	
diff --git a/source/blender/makesdna/DNA_fileglobal_types.h b/source/blender/makesdna/DNA_fileglobal_types.h
index f0f8fe7..040b55d 100644
--- a/source/blender/makesdna/DNA_fileglobal_types.h
+++ b/source/blender/makesdna/DNA_fileglobal_types.h
@@ -48,8 +48,8 @@ typedef struct FileGlobal {
 	struct Scene *curscene;
 	int fileflags;
 	int globalf;
-	unsigned long build_commit_timestamp;  /* commit timestamp from buildinfo */
-	char build_hash[12];  /* hash from buildinfo */
+	uint64_t build_commit_timestamp;  /* commit timestamp from buildinfo */
+	char build_hash[16];  /* hash from buildinfo */
 	/* file path where this was saved, for recover */
 	char filename[1024]; /* 1024 = FILE_MAX */
 } FileGlobal;
diff --git a/source/gameengine/Ketsji/KX_PythonMain.h b/source/gameengine/Ketsji/KX_PythonMain.h
index e638fa9..c627a4a 100644
--- a/source/gameengine/Ketsji/KX_PythonMain.h
+++ b/source/gameengine/Ketsji/KX_PythonMain.h
@@ -32,6 +32,7 @@
 #ifndef __KX_PYTHON_MAIN__
 #define __KX_PYTHON_MAIN__
 
+#include "BLI_sys_types.h"
 #include "BKE_main.h"
 #include "DNA_scene_types.h"
 extern "C" char *KX_GetPythonMain(struct Scene* scene);




More information about the Bf-blender-cvs mailing list