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
This commit is contained in:
parent
abe95fbdff
commit
1395ba70bf
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in New Issue