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>2021-10-25 10:58:16 +0300
committerBastien Montagne <bastien@blender.org>2021-10-25 11:57:41 +0300
commit15762e961127fb8fbde1855311e01f99dfe5677e (patch)
tree66d38d853319e802485e91a146e675068512d05f /source/blender
parentd16e7326386d055fc5cdfa9f60bcd3d75bcbbed5 (diff)
Fix T92430: Infinite recursion in some cases in new append code.
Shapekeys, always shapekeys... Since we cannot deal with them as regular IDs, we need to handle potential recursion cases ourselves here. sigh.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index c88e577df6a..97e610b797d 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -583,8 +583,13 @@ static int foreach_libblock_append_callback(LibraryIDLinkCallbackData *cb_data)
/* While we do not want to add non-linkable ID (shape keys...) to the list of linked items,
* unfortunately they can use fully linkable valid IDs too, like actions. Those need to be
* processed, so we need to recursively deal with them here. */
- BKE_library_foreach_ID_link(
- cb_data->bmain, id, foreach_libblock_append_callback, data, IDWALK_NOP);
+ /* NOTE: Since we are by-passing checks in `BKE_library_foreach_ID_link` by manually calling it
+ * recursively, we need to take care of potential recursion cases ourselves (e.g.animdata of
+ * shapekey referencing the shapekey itself). */
+ if (id != cb_data->id_self) {
+ BKE_library_foreach_ID_link(
+ cb_data->bmain, id, foreach_libblock_append_callback, data, IDWALK_NOP);
+ }
return IDWALK_RET_NOP;
}