Blender Git Loki

Git Commits -> Revision e9220d5

Revision e9220d5 by Sergey Sharybin (master)
March 11, 2020, 16:38 (GMT)
Depsgraph: Fix crash deleting Viewer image from Outliner

Was happening when having compositor open with Viewer node attached
directly to Render Layers output.

There were two things involved here:

1. The code which was storing CoW-ed versions of IDs was checking all
IDs for whether they are expanded or not. This was causing access
of freed memory for deleted IDs which do not need CoW (such as IM).

Simple fix: store ID type as a scalar and use early check before
doing more elaborate check based on accessing fields of id_cow.

2. The code which was ensuring view layer pointer is doing CoW for
scene. This isn't an issue on its own, but scene might have an
embedded ID such as compositor which was actually traversed by the
ID remap routines. This was causing remapping procedure to go into
non-updated copy of compositor, accessing freed Viewer image ID.

Solved by not recursing into embedded IDs for datablocks as those
are supposed to have own copy-on-write operations which takes care
of re-mapping.

Reported my Bastien, and also pair-coded with him.

Commit Details:

Full Hash: e9220d5cd013340bde288c85b5125028c1400499
Parent Commit: 19b46b2
Lines Changed: +38, -6

6 Modified Paths:

/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc (+12, -0) (Diff)
/source/blender/depsgraph/intern/eval/deg_eval.cc (+7, -4) (Diff)
/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc (+10, -2) (Diff)
/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h (+3, -0) (Diff)
/source/blender/depsgraph/intern/node/deg_node_id.cc (+1, -0) (Diff)
/source/blender/depsgraph/intern/node/deg_node_id.h (+5, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021