diff options
author | Robert Guetzkow <rjg> | 2020-03-19 02:47:27 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-03-19 02:49:46 +0300 |
commit | f70241deba0edd65e7b4ca924ee85cf3795cd4af (patch) | |
tree | 0b92ad8ab8ccfd4bc8004a890d1bfc916e4107b2 /source/blender/editors/space_sequencer | |
parent | 271231f58ee376b576d72e3ecdb68899bb84d724 (diff) |
Fix (unreported): Crash on accessing active sequence in select groupped operator
This patch moves the NULL check of `actseq` to the correct position, which should happen
before the `channel` is assigned. Otherwise an attempt to call the `sequencer_select_grouped_exec`,
when there is no active sequence and `use_active_channel` set to true, results in a crash.
Reviewed By: ISS
Differential Revision: https://developer.blender.org/D7170
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_select.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index da4a69a9b33..7f243b8a6ad 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -1419,17 +1419,17 @@ static int sequencer_select_grouped_exec(bContext *C, wmOperator *op) Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq, *actseq = BKE_sequencer_active_get(scene); + if (actseq == NULL) { + BKE_report(op->reports, RPT_ERROR, "No active sequence!"); + return OPERATOR_CANCELLED; + } + const int type = RNA_enum_get(op->ptr, "type"); const int channel = RNA_boolean_get(op->ptr, "use_active_channel") ? actseq->machine : 0; const bool extend = RNA_boolean_get(op->ptr, "extend"); bool changed = false; - if (actseq == NULL) { - BKE_report(op->reports, RPT_ERROR, "No active sequence!"); - return OPERATOR_CANCELLED; - } - if (!extend) { SEQP_BEGIN (ed, seq) { seq->flag &= ~SELECT; |