Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2022-06-23 19:11:33 +0300
committerThomas Dinges <blender@dingto.org>2022-06-24 12:09:47 +0300
commit2d54b0f275dfc4060607eca10886dc8af7751824 (patch)
tree6b608e37dc914d960f8e81ec0a591a06decfd9e3
parent32481a5732f2ce785c7a8b27145683391513c003 (diff)
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.
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c5
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h1
-rw-r--r--source/blender/editors/space_sequencer/sequencer_view.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 0305ad279a0..96961656318 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -174,6 +174,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 67df065ef35..69c1a9df577 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 b3dbc3c72d1..ee1c14e318d 100644
--- a/source/blender/editors/space_sequencer/sequencer_view.c
+++ b/source/blender/editors/space_sequencer/sequencer_view.c
@@ -375,7 +375,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;