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:
authorRichard Antalik <richardantalik@gmail.com>2022-04-21 01:05:57 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-04-21 12:09:06 +0300
commit851dff6ee95f2df2c27eb0217786c53317857ef4 (patch)
tree615b7fb8ddd0c549a331ed327356c90b4b22d870 /source/blender/sequencer/intern/channels.c
parentcd8e9d5c1e261be884f0450addde64551b396d60 (diff)
Fix T97356: Crash when adding adjustment layer strip
Crash was caused by incorrectly assuming, that rendered strip is meta when editing code in bulk, but this wasn't true and strip had no channels initialized, which caused crash on NULL dereference. Correct approach is to find list of channels where on same level as rendered strip, similar to how `SEQ_get_seqbase_by_seq` function works for list of strips.
Diffstat (limited to 'source/blender/sequencer/intern/channels.c')
-rw-r--r--source/blender/sequencer/intern/channels.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/sequencer/intern/channels.c b/source/blender/sequencer/intern/channels.c
index e8e82af03f5..21e3461c7d0 100644
--- a/source/blender/sequencer/intern/channels.c
+++ b/source/blender/sequencer/intern/channels.c
@@ -81,3 +81,19 @@ bool SEQ_channel_is_muted(const SeqTimelineChannel *channel)
{
return (channel->flag & SEQ_CHANNEL_MUTE) != 0;
}
+
+ListBase *SEQ_get_channels_by_seq(ListBase *seqbase, const Sequence *seq)
+{
+ ListBase *lb = NULL;
+
+ LISTBASE_FOREACH (Sequence *, iseq, seqbase) {
+ if (seq == iseq) {
+ return seqbase;
+ }
+ if ((lb = SEQ_get_channels_by_seq(&iseq->seqbase, seq))) {
+ return lb;
+ }
+ }
+
+ return NULL;
+}