diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2022-06-21 16:26:03 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-06-21 16:28:11 +0300 |
commit | 15bc3d260d64b39d31a3102030088be347aa14fb (patch) | |
tree | b6699aac56f658e9940612b0fbf542fb463f4d38 /source/blender/blenkernel/intern/nla.c | |
parent | d373206c3f99ea35cfce67d73d7e9bf25fd464f0 (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 a6d2c78216a..1900ae2e9ad 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -311,7 +311,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; } |