From 495f679246b292e7c10aea073be402dedba4ceee Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 14 Apr 2023 18:46:30 +0200 Subject: [PATCH] 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... --- source/blender/editors/space_outliner/space_outliner.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc index b7a3d0d7e64..4406dd7afaf 100644 --- a/source/blender/editors/space_outliner/space_outliner.cc +++ b/source/blender/editors/space_outliner/space_outliner.cc @@ -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(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;