[Bf-blender-cvs] [f70241deba0] master: Fix (unreported): Crash on accessing active sequence in select groupped operator

Robert Guetzkow noreply at git.blender.org
Thu Mar 19 00:58:42 CET 2020


Commit: f70241deba0edd65e7b4ca924ee85cf3795cd4af
Author: Robert Guetzkow
Date:   Thu Mar 19 00:47:27 2020 +0100
Branches: master
https://developer.blender.org/rBf70241deba0edd65e7b4ca924ee85cf3795cd4af

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

===================================================================

M	source/blender/editors/space_sequencer/sequencer_select.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list