diff options
author | Richard Antalik <richardantalik@gmail.com> | 2020-11-19 15:10:42 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-11-19 15:10:42 +0300 |
commit | 1395ba70bf37bc0a21920416b0abbaac9af2b7e5 (patch) | |
tree | cf8fc1d482bfafdeed19283dc5b080dd93e693f3 /source/blender/makesrna/intern/rna_sequencer_api.c | |
parent | abe95fbdff2eed89ccd70173ee817f1834faf54a (diff) |
Fix crash when adding strip using RNA API call
Don't allocate StripElem for movieclip, scene and mask strips. This
struct is not handled in seq_dupli function. This caused field to be
uninitialized in COW datablock.
StripElem is not allocated when adding strip with operator and it is
not needed for these strip types.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9600
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer_api.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 9b8386dd1b1..5419fc4ac7c 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -89,7 +89,9 @@ static Sequence *alloc_generic_sequence( Strip *strip = seq->strip; - if (file) { + /* Don't allocate StripElem for clip, mask and scene types. This struct is not handled in + * seq_dupli() function. */ + if (file && !ELEM(type, SEQ_TYPE_MOVIECLIP, SEQ_TYPE_MASK, SEQ_TYPE_SCENE)) { strip->stripdata = se = MEM_callocN(sizeof(StripElem), "stripelem"); BLI_split_dirfile(file, strip->dir, se->name, sizeof(strip->dir), sizeof(se->name)); |