Fix dangling pointer while scrubbing in the sequencer

SeqCache::last_key could be set to freed memory while scrubbing
two images in the sequencer.
This commit is contained in:
Campbell Barton
2023-08-29 17:19:49 +10:00
parent 941dbbc175
commit ebd4d1e2d6

View File

@@ -579,7 +579,9 @@ void seq_cache_free_temp_cache(Scene *scene, short id, int timeline_frame)
{
seq_cache_key_unlink(key);
BLI_ghash_remove(cache->hash, key, seq_cache_keyfree, seq_cache_valfree);
BLI_assert(key != cache->last_key);
if (key == cache->last_key) {
cache->last_key = nullptr;
}
}
}
}