Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2021-04-22 15:09:33 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-04-22 15:16:32 +0300
commit0ba0d27d368422b29db42c09f0ef658ce5b1e604 (patch)
tree5f1e48ddb2b96ddbf11a105054a99f8dd7f50e8e
parent71db02ed887d8b9db958b482aa42cc27f0e57ed2 (diff)
Fix T87090: VSE scrubbing locks up blender
Speed effect caused, that some raw frames are re-used for multiple final frames. When cached final frame is freed due to memory being full, it tried to free also lower level cached frames that were used during compositing. Some lower level cached frames were already freed by different final frame and `BLI_ghash_remove()` failed. Check if key still exists in hash or if linked keys were overwritten before removing them. Reviewed By: sergey Differential Revision: https://developer.blender.org/D10909
-rw-r--r--source/blender/sequencer/intern/image_cache.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/sequencer/intern/image_cache.c b/source/blender/sequencer/intern/image_cache.c
index 290ee185865..089bb5a6bec 100644
--- a/source/blender/sequencer/intern/image_cache.c
+++ b/source/blender/sequencer/intern/image_cache.c
@@ -976,14 +976,34 @@ static void seq_cache_recycle_linked(Scene *scene, SeqCacheKey *base)
SeqCacheKey *next = base->link_next;
while (base) {
+ if (!BLI_ghash_haskey(cache->hash, base)) {
+ break; /* Key has already been removed from cache. */
+ }
+
SeqCacheKey *prev = base->link_prev;
+ if (prev != NULL && prev->link_next != base) {
+ /* Key has been removed and replaced and doesn't belong to this chain anymore. */
+ base->link_prev = NULL;
+ break;
+ }
+
BLI_ghash_remove(cache->hash, base, seq_cache_keyfree, seq_cache_valfree);
base = prev;
}
base = next;
while (base) {
+ if (!BLI_ghash_haskey(cache->hash, base)) {
+ break; /* Key has already been removed from cache. */
+ }
+
next = base->link_next;
+ if (next != NULL && next->link_prev != base) {
+ /* Key has been removed and replaced and doesn't belong to this chain anymore. */
+ base->link_next = NULL;
+ break;
+ }
+
BLI_ghash_remove(cache->hash, base, seq_cache_keyfree, seq_cache_valfree);
base = next;
}