Fix T37488: Crash with --debug reading userpref.blend
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 18 Nov 2013 12:13:23 +0000 (18:13 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 18 Nov 2013 12:13:23 +0000 (18:13 +0600)
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.

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

index 629eda3b583ed5a895f2894d722488945f6890de..7b7b69034a99811f554fc6b944adc77b94a93e28 100644 (file)
@@ -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 */
        
index f0f8fe7d40c320c7e86ef195330920d96604d0fc..040b55d9eb6397ae5b0ad0029c13b207714e5725 100644 (file)
@@ -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;
index e638fa9094e9020274a5ca8bff1476897c446ba0..c627a4a147a85ef93e3676f713eef4bb97d9f9f7 100644 (file)
@@ -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);