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>2020-12-17 04:11:22 +0300
committerRichard Antalik <richardantalik@gmail.com>2020-12-17 04:19:34 +0300
commitd11b219d40d7c72156fd11c335fde27212997957 (patch)
treed1c3e20758ae379fc1bc483d79d116213bb260a3 /source/blender/sequencer/intern/strip_time.c
parent3a1d1aaa86d0d7cc6aaf0e6633d557bbcdd0b514 (diff)
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
Diffstat (limited to 'source/blender/sequencer/intern/strip_time.c')
-rw-r--r--source/blender/sequencer/intern/strip_time.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/source/blender/sequencer/intern/strip_time.c b/source/blender/sequencer/intern/strip_time.c
index 015d81cc217..d9074b2a683 100644
--- a/source/blender/sequencer/intern/strip_time.c
+++ b/source/blender/sequencer/intern/strip_time.c
@@ -361,28 +361,26 @@ float BKE_sequence_get_fps(Scene *scene, Sequence *seq)
*/
void SEQ_timeline_boundbox(const Scene *scene, const ListBase *seqbase, rctf *rect)
{
- float min[2], max[2];
- min[0] = scene->r.sfra;
- max[0] = scene->r.efra + 1;
- min[1] = 0.0;
- max[1] = 8.0;
+ rect->xmin = scene->r.sfra;
+ rect->xmax = scene->r.efra + 1;
+ rect->ymin = 0.0f;
+ rect->ymax = 8.0f;
+
+ if (seqbase == NULL) {
+ return;
+ }
LISTBASE_FOREACH (Sequence *, seq, seqbase) {
- if (min[0] > seq->startdisp - 1) {
- min[0] = seq->startdisp - 1;
+ if (rect->xmin > seq->startdisp - 1) {
+ rect->xmin = seq->startdisp - 1;
}
- if (max[0] < seq->enddisp + 1) {
- max[0] = seq->enddisp + 1;
+ if (rect->xmax < seq->enddisp + 1) {
+ rect->xmax = seq->enddisp + 1;
}
- if (max[1] < seq->machine + 2) {
- max[1] = seq->machine + 2;
+ if (rect->ymax < seq->machine + 2) {
+ rect->ymax = seq->machine + 2;
}
}
-
- rect->xmin = min[0];
- rect->xmax = max[0];
- rect->ymin = min[1];
- rect->ymax = max[1];
}
/**