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:
authorJulian Eisel <julian@blender.org>2020-12-07 15:54:11 +0300
committerJulian Eisel <julian@blender.org>2020-12-07 16:35:54 +0300
commit0c0bc619181419a3005faf034706d77ef24457e6 (patch)
treeaaf7325582d8877ca8a83e1d22a8306bf1d94607
parentcf9275dd4e452717faffa0e502814af01d84d539 (diff)
Fix access to invalid data in Outliner tree building
Non-ID tree-elements would cast their data pointer to `ID *` and take the name and ID-Code from there. The name would actually be overridden a few lines later, so that didn't cause issues. But the ID-Code stored inside the tree element kept an undefined value. In practice that probably didn't cause many issues either, since it's just an undefined value that was very unlikely to take a valid 16-bit ID-code value, meaning ID-Code checks would simply fail as they should. Further there typically are other checks to see if the element actually represents an ID. However, in theory this may have caused a few random crashes or data-corruptions.
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 37f748692f9..811aaa1ba2e 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -965,7 +965,7 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
else if (ELEM(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
/* pass */
}
- else if (type == TSE_ANIM_DATA) {
+ else if (ELEM(type, TSE_ANIM_DATA, TSE_NLA, TSE_NLA_TRACK, TSE_DRIVER_BASE)) {
/* pass */
}
else if (type == TSE_GP_LAYER) {
@@ -977,7 +977,13 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
else if (type == TSE_ID_BASE) {
/* pass */
}
+ else if (ELEM(type, TSE_KEYMAP, TSE_KEYMAP_ITEM)) {
+ /* pass */
+ }
else {
+ /* Other cases must be caught above. */
+ BLI_assert(TSE_IS_REAL_ID(tselem));
+
/* do here too, for blend file viewer, own ID_LI then shows file name */
if (GS(id->name) == ID_LI) {
te->name = ((Library *)id)->filepath;