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:
authorSergey Sharybin <sergey@blender.org>2021-07-07 15:21:23 +0300
committerSergey Sharybin <sergey@blender.org>2021-07-07 15:22:52 +0300
commitcffbfe55682073de39ab93fe676e495e62145e12 (patch)
treed5af95f27c93eb6be4043acf1efa2e5285b9a0b4
parentecbf838feefc9b064b71297b74613e7b094ee8d7 (diff)
Fix crash accessing sequencer strips
Was caused by recent clange sequences_all iterator in RNA (D11793).
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 0c46450759d..5f6456d3d1e 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -199,7 +199,10 @@ static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *i
bli_iter->data = MEM_callocN(sizeof(SeqIterator), __func__);
iter->internal.custom = bli_iter;
- SEQ_iterator_ensure(all_strips, bli_iter->data, (Sequence **)&bli_iter->current);
+ if (!SEQ_iterator_ensure(all_strips, bli_iter->data, (Sequence **)&bli_iter->current)) {
+ SEQ_collection_free(all_strips);
+ }
+
iter->valid = bli_iter->current != NULL;
}
@@ -220,7 +223,9 @@ static void rna_SequenceEditor_sequences_all_end(CollectionPropertyIterator *ite
{
BLI_Iterator *bli_iter = iter->internal.custom;
SeqIterator *seq_iter = bli_iter->data;
- SEQ_collection_free(seq_iter->collection);
+ if (seq_iter->collection != NULL) {
+ SEQ_collection_free(seq_iter->collection);
+ }
MEM_freeN(seq_iter);
MEM_freeN(bli_iter);
}