[Bf-blender-cvs] [5c6ffd07e0d] master: Fix T99110: Crash after running view_all operator in VSE
Richard Antalik
noreply at git.blender.org
Thu Jun 23 18:21:46 CEST 2022
Commit: 5c6ffd07e0de8f4917927da69a68db9af205973d
Author: Richard Antalik
Date: Thu Jun 23 18:11:33 2022 +0200
Branches: master
https://developer.blender.org/rB5c6ffd07e0de8f4917927da69a68db9af205973d
Fix T99110: Crash after running view_all operator in VSE
Crash caused by NULL dereference, when `Editing` is not initialized.
Check if data is initialized in poll function.
===================================================================
M source/blender/editors/space_sequencer/sequencer_edit.c
M source/blender/editors/space_sequencer/sequencer_intern.h
M source/blender/editors/space_sequencer/sequencer_view.c
===================================================================
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 86c438c616e..16f663110ec 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -173,6 +173,11 @@ bool sequencer_edit_poll(bContext *C)
return (SEQ_editing_get(CTX_data_scene(C)) != NULL);
}
+bool sequencer_editing_initialized_and_active(bContext *C)
+{
+ return ED_operator_sequencer_active(C) && sequencer_edit_poll(C);
+}
+
#if 0 /* UNUSED */
bool sequencer_strip_poll(bContext *C)
{
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index 3307c3fde2f..3f91be9e9e8 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -133,6 +133,7 @@ int seq_effect_find_selected(struct Scene *scene,
/* Operator helpers. */
bool sequencer_edit_poll(struct bContext *C);
+bool sequencer_editing_initialized_and_active(struct bContext *C);
/* UNUSED */
/* bool sequencer_strip_poll(struct bContext *C); */
bool sequencer_strip_has_path_poll(struct bContext *C);
diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c
index 857ca6d989b..f7ca753c052 100644
--- a/source/blender/editors/space_sequencer/sequencer_view.c
+++ b/source/blender/editors/space_sequencer/sequencer_view.c
@@ -373,7 +373,7 @@ void SEQUENCER_OT_view_selected(wmOperatorType *ot)
/* Api callbacks. */
ot->exec = sequencer_view_selected_exec;
- ot->poll = ED_operator_sequencer_active;
+ ot->poll = sequencer_editing_initialized_and_active;
/* Flags. */
ot->flag = OPTYPE_REGISTER;
More information about the Bf-blender-cvs
mailing list