Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-07-11 20:04:24 +0300
committerBastien Montagne <bastien@blender.org>2022-07-11 20:16:04 +0300
commit995c904d00e1e0713a1549ca16b2775a9dcdd281 (patch)
tree85992b203cf070e7bf5c53d46ba529a3c6a5acc0 /source/blender/blenkernel/intern/lib_override.cc
parent8ca09e6c5eb6ac5401f7e7d89185e341921e7d3a (diff)
Fix (unreported) crash in liboverride code on rare cases.
When dealing with 'embedded' IDs (and the like, e.g. shape keys), liboverride code could fail in case the reference linked data (e.g. a mesh) would not have a shapekey anymore, while the override mesh would still have one. Found while investigating another issue in Heist production file `Heist/pro/animation_test/einar/einar_new_expression_shapes2.blend`, r1230.
Diffstat (limited to 'source/blender/blenkernel/intern/lib_override.cc')
-rw-r--r--source/blender/blenkernel/intern/lib_override.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc
index d816b5ede5f..cdea97b6c6a 100644
--- a/source/blender/blenkernel/intern/lib_override.cc
+++ b/source/blender/blenkernel/intern/lib_override.cc
@@ -1771,6 +1771,11 @@ static bool lib_override_library_resync(Main *bmain,
break;
}
}
+ if (reference_id == nullptr) {
+ /* Can happen e.g. when there is a local override of a shapekey, but the matching linked
+ * obdata (mesh etc.) does not have any shapekey anymore. */
+ continue;
+ }
BLI_assert(GS(reference_id->name) == GS(id->name));
if (!BLI_ghash_haskey(linkedref_to_old_override, reference_id)) {