Fix (unreported) outliner readfile code doing invalid ID pointer reading.

Code re-reading new ID pointers addresses inside readfile process would
not ensure that the 'ID' pointer of the outliner's treestore element is
actually a real ID pointer, and not a 'fake' one.

Probably harmless in practice, though this could have potentially been
the cause of extremely random rare crashes or corruption...
This commit is contained in:
Bastien Montagne
2023-04-14 18:46:30 +02:00
parent 0cb17a7036
commit 495f679246

View File

@@ -488,7 +488,9 @@ static void outliner_blend_read_lib(BlendLibReader *reader, ID * /*parent_id*/,
BLI_mempool_iternew(space_outliner->treestore, &iter);
while ((tselem = static_cast<TreeStoreElem *>(BLI_mempool_iterstep(&iter)))) {
BLO_read_id_address(reader, nullptr, &tselem->id);
if (TSE_IS_REAL_ID(tselem)) {
BLO_read_id_address(reader, nullptr, &tselem->id);
}
}
/* rebuild hash table, because it depends on ids too */
space_outliner->storeflag |= SO_TREESTORE_REBUILD;