From d11b219d40d7c72156fd11c335fde27212997957 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Thu, 17 Dec 2020 02:11:22 +0100 Subject: Fix T83869: Crash when creating Sequencer in new scene Crash on null dereference in `SEQ_timeline_boundbox()`. This function was generalized in rB9e4a4c2e996c to work on arbitrary `seqbase`. Fixed by refactoring `SEQ_timeline_boundbox()` functions to return default sane values if `seqbase` is `NULL` Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D9878 --- source/blender/editors/space_sequencer/sequencer_draw.c | 2 +- source/blender/editors/space_sequencer/sequencer_view.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_sequencer') diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 5ad1e2399f5..d7d601a3c76 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -2305,7 +2305,7 @@ void draw_timeline_seq(const bContext *C, ARegion *region) UI_view2d_view_ortho(v2d); /* Get timeline bound-box, needed for the scroll-bars. */ - SEQ_timeline_boundbox(scene, ed->seqbasep, &v2d->tot); + SEQ_timeline_boundbox(scene, SEQ_active_seqbase_get(ed), &v2d->tot); draw_seq_backdrop(v2d); UI_view2d_constant_grid_draw(v2d, FPS); diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c index d2166705943..e12c43b7804 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.c +++ b/source/blender/editors/space_sequencer/sequencer_view.c @@ -90,11 +90,7 @@ static int sequencer_view_all_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); const Editing *ed = BKE_sequencer_editing_get(scene, false); - if (ed == NULL) { - return OPERATOR_FINISHED; - } - - SEQ_timeline_boundbox(scene, ed->seqbasep, &box); + SEQ_timeline_boundbox(scene, SEQ_active_seqbase_get(ed), &box); UI_view2d_smooth_view(C, region, &box, smooth_viewtx); return OPERATOR_FINISHED; } -- cgit v1.2.3