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
This commit is contained in:
Robert Guetzkow 2020-03-19 00:47:27 +01:00 committed by Richard Antalik
parent 271231f58e
commit f70241deba
1 changed files with 5 additions and 5 deletions

View File

@ -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;