[Bf-blender-cvs] [5bad8913941] uuid-id: Safeguard against overflow of static uuid counter.

Bastien Montagne noreply at git.blender.org
Tue Mar 3 15:05:44 CET 2020


Commit: 5bad8913941e7b3ed404275abd637eff293e744e
Author: Bastien Montagne
Date:   Tue Mar 3 15:05:12 2020 +0100
Branches: uuid-id
https://developer.blender.org/rB5bad8913941e7b3ed404275abd637eff293e744e

Safeguard against overflow of static uuid counter.

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

M	source/blender/blenkernel/intern/lib_id.c

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

diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index 542f7db1d2e..5a84b78af09 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -1384,6 +1384,11 @@ void BKE_lib_libblock_uuid_ensure(ID *id)
 
   if (id->session_uuid == MAIN_ID_SESSION_UUID_UNSET) {
     id->session_uuid = ++global_session_uuid;
+    /* In case overflow happens, still assign a valid ID. This way opening files many times works
+     * correctly. */
+    if (id->session_uuid == MAIN_ID_SESSION_UUID_UNSET) {
+      id->session_uuid = ++global_session_uuid;
+    }
   }
 }



More information about the Bf-blender-cvs mailing list