Fix T79575: Crash loading nested set-scenes

This commit is contained in:
Campbell Barton 2020-08-06 17:12:45 +10:00 committed by Jeroen Bakker
parent 16b4b412e6
commit 5c917ef032
Notes: blender-bot 2023-02-14 05:04:52 +01:00
Referenced by issue #79575, Crash on loading blends with nested BG scenes
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}