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.
This commit is contained in:
Sybren A. Stüvel
2022-06-21 15:26:03 +02:00
parent d373206c3f
commit 15bc3d260d

View File

@@ -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;
}