diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2022-06-21 16:26:03 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-06-22 12:30:48 +0300 |
commit | 455d227831c620873de394817a2153b0f6c6ff9d (patch) | |
tree | b71ae1f9e4d9fb32104219e222fd48d8b23f288c /source/blender/blenkernel/intern/nla.c | |
parent | a8cf65fcd6b0118aedf47bac687e27ae25f377b3 (diff) |
Fix 2 for T98700: Crash when recursively nesting NLA meta strips
When searching for the active NLA strip, avoid overwriting the found strip
pointer with NULL if it was already found in a previous iteration.
The active strip is searched for while looping over the NLA tracks. If the
active strip was found on a previous track, and not on the current track,
this would effectively set `actstrip = NULL`. This is now avoided.
Another benefit is that the search for the active strip is stopped as soon
as it's found, which should increase performance a tiny bit.
Diffstat (limited to 'source/blender/blenkernel/intern/nla.c')
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 8f54d71108a..a345aac3d12 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -306,7 +306,11 @@ static void update_active_track(AnimData *adt_dest, const AnimData *adt_source) if (track_source == adt_source->act_track) { adt_dest->act_track = track_dest; } - update_active_strip(adt_dest, track_dest, adt_source, track_source); + + /* Only search for the active strip if it hasn't been found yet. */ + if (adt_dest->actstrip == NULL && adt_source->actstrip != NULL) { + update_active_strip(adt_dest, track_dest, adt_source, track_source); + } track_dest = track_dest->next; } |