Fix T98021: Crash when using scene strip as sequencer input

Issue was caused by treating such strip as meta and using
`seq->channels` directly, which is not valid for scene strips.

Pointer to channels is now provided by function
`SEQ_get_seqbase_from_sequence`.
This commit is contained in:
2022-05-17 21:08:49 +02:00
parent b48adbc9d7
commit 35e73aa347
4 changed files with 19 additions and 12 deletions

View File

@@ -1586,10 +1586,10 @@ static ImBuf *do_render_strip_seqbase(const SeqRenderData *context,
{
ImBuf *ibuf = NULL;
ListBase *seqbase = NULL;
ListBase *channels = &seq->channels;
ListBase *channels = NULL;
int offset;
seqbase = SEQ_get_seqbase_from_sequence(seq, &offset);
seqbase = SEQ_get_seqbase_from_sequence(seq, &channels, &offset);
if (seqbase && !BLI_listbase_is_empty(seqbase)) {

View File

@@ -225,13 +225,14 @@ const char *SEQ_sequence_give_name(Sequence *seq)
return name;
}
ListBase *SEQ_get_seqbase_from_sequence(Sequence *seq, int *r_offset)
ListBase *SEQ_get_seqbase_from_sequence(Sequence *seq, ListBase **r_channels, int *r_offset)
{
ListBase *seqbase = NULL;
switch (seq->type) {
case SEQ_TYPE_META: {
seqbase = &seq->seqbase;
*r_channels = &seq->channels;
*r_offset = seq->start;
break;
}
@@ -240,6 +241,7 @@ ListBase *SEQ_get_seqbase_from_sequence(Sequence *seq, int *r_offset)
Editing *ed = SEQ_editing_get(seq->scene);
if (ed) {
seqbase = &ed->seqbase;
*r_channels = &ed->channels;
*r_offset = seq->scene->r.sfra;
}
}