From ebd4d1e2d660ef1bcfed0ff40fa445d2ce4b2e9c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Aug 2023 17:19:49 +1000 Subject: [PATCH] Fix dangling pointer while scrubbing in the sequencer SeqCache::last_key could be set to freed memory while scrubbing two images in the sequencer. --- source/blender/sequencer/intern/image_cache.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/sequencer/intern/image_cache.cc b/source/blender/sequencer/intern/image_cache.cc index c9f5417b0ff..53100ab7b14 100644 --- a/source/blender/sequencer/intern/image_cache.cc +++ b/source/blender/sequencer/intern/image_cache.cc @@ -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; + } } } }