diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-04-04 17:27:37 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-04-04 17:30:16 +0300 |
commit | e4289f23604a4dfa1b3ba45b9e5eaf7bf47f420c (patch) | |
tree | c236ae651a516826a716e14b0c785c39a03a2e86 /source/blender/editors/screen | |
parent | e7f4aa8f0cb617327e0358c134bc606bfb8742d4 (diff) |
Fix errors in sequencer channel headers
Failing constraint test uncovered crashes on NULL dereference and
missing channels initialization in `SEQ_editing_ensure()`.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_context.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index d718c8b0d95..11a62123ad7 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -647,18 +647,20 @@ static eContextResult screen_ctx_selected_editable_sequences(const bContext *C, wmWindow *win = CTX_wm_window(C); Scene *scene = WM_window_get_active_scene(win); Editing *ed = SEQ_editing_get(scene); + if (ed == NULL) { + return CTX_RESULT_NO_DATA; + } + ListBase *channels = SEQ_channels_displayed_get(ed); - if (ed) { - LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) { - if (seq->flag & SELECT && !SEQ_transform_is_locked(channels, seq)) { - CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq); - } + LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) { + if (seq->flag & SELECT && !SEQ_transform_is_locked(channels, seq)) { + CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq); } - CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); - return CTX_RESULT_OK; } - return CTX_RESULT_NO_DATA; + CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); + return CTX_RESULT_OK; } + static eContextResult screen_ctx_active_nla_track(const bContext *C, bContextDataResult *result) { PointerRNA ptr; |