Fix (unreported) potential invalid usage of Main relations cache.

`library_foreach_ID_link` should only use Main ID relations cache if no
'special' relations flag is set.
This commit is contained in:
2023-03-07 18:25:50 +01:00
parent d0918c5c7f
commit ec1a76d9cd

View File

@@ -272,7 +272,7 @@ static bool library_foreach_ID_link(Main *bmain,
}
if (bmain != NULL && bmain->relations != NULL && (flag & IDWALK_READONLY) &&
(flag & IDWALK_DO_INTERNAL_RUNTIME_POINTERS) == 0 &&
(flag & (IDWALK_DO_INTERNAL_RUNTIME_POINTERS | IDWALK_DO_LIBRARY_POINTER)) == 0 &&
(((bmain->relations->flag & MAINIDRELATIONS_INCLUDE_UI) == 0) ==
((data.flag & IDWALK_INCLUDE_UI) == 0))) {
/* Note that this is minor optimization, even in worst cases (like id being an object with