Commit: cffbfe55682073de39ab93fe676e495e62145e12
Author: Sergey Sharybin
Date:   Wed Jul 7 14:21:23 2021 +0200
Branches: master
https://developer.blender.org/rBcffbfe55682073de39ab93fe676e495e62145e12

Fix crash accessing sequencer strips

Was caused by recent clange sequences_all iterator in RNA (D11793).

===================================================================

M       source/blender/makesrna/intern/rna_sequencer.c

===================================================================

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);
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to