Fix T79757: Crash on prefetch when renaming strips

Original sequence lookup failed, becase name changed in another thread.
Fix is same as 0471349c90df - stop prefetching before changing content
of seqbase.

I have covered more cases, and added assert so it is more obvious that
issue is in lookup, and it shouldn't fail.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8592
This commit is contained in:
Richard Antalik
2020-08-17 20:19:11 +02:00
parent 2b896fc481
commit 4b69e55da3
3 changed files with 9 additions and 0 deletions

View File

@@ -1329,6 +1329,7 @@ void BKE_sequencer_cache_put(const SeqRenderData *context,
context = BKE_sequencer_prefetch_get_original_context(context);
scene = context->scene;
seq = BKE_sequencer_prefetch_get_original_sequence(seq, scene);
BLI_assert(seq != NULL);
}
/* Prevent reinserting, it breaks cache key linking. */

View File

@@ -2751,6 +2751,8 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
seq = ed->seqbasep->first; /* Poll checks this is valid. */
BKE_sequencer_prefetch_stop(scene);
while (seq) {
if ((seq->flag & SELECT) && (seq->type == SEQ_TYPE_IMAGE) && (seq->len > 1)) {
Sequence *seq_next;
@@ -2946,6 +2948,8 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
BKE_sequencer_prefetch_stop(scene);
/* Remove all selected from main list, and put in meta. */
seqm = BKE_sequence_alloc(ed->seqbasep, 1, 1, SEQ_TYPE_META); /* Channel number set later. */
@@ -3031,6 +3035,8 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
}
BKE_sequencer_prefetch_stop(scene);
for (seq = last_seq->seqbase.first; seq != NULL; seq = seq->next) {
BKE_sequence_invalidate_cache_composite(scene, seq);
}

View File

@@ -637,6 +637,8 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
char oldname[sizeof(seq->name)];
AnimData *adt;
BKE_sequencer_prefetch_stop(scene);
/* make a copy of the old name first */
BLI_strncpy(oldname, seq->name + 2, sizeof(seq->name) - 2);