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:
authorCampbell Barton <ideasman42@gmail.com>2020-08-06 10:12:45 +0300
committerJeroen Bakker <jeroen@blender.org>2020-08-12 10:25:48 +0300
commit5c917ef0323a3741216d696af09b53b4025abb78 (patch)
treecfd79f885f61e9b8e8a08e348f53816b1442c61b
parent16b4b412e6b380eb92b5e66d7ba932f715943f28 (diff)
Fix T79575: Crash loading nested set-scenes
-rw-r--r--source/blender/blenloader/intern/readfile.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 1b0c2cbac15..c3cfaa8561f 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6561,6 +6561,14 @@ static bool scene_validate_setscene__liblink(Scene *sce, const int totscene)
}
for (a = 0, sce_iter = sce; sce_iter->set; sce_iter = sce_iter->set, a++) {
+ /* This runs per library (before each libraries #Main has been joined),
+ * so we can't step into other libraries since `totscene` is only for this library.
+ *
+ * Also, other libraries may not have been linked yet,
+ * while we could check #LIB_TAG_NEED_LINK the library pointer check is sufficient. */
+ if (sce->id.lib != sce_iter->id.lib) {
+ return true;
+ }
if (sce_iter->flag & SCE_READFILE_LIBLINK_NEED_SETSCENE_CHECK) {
return true;
}