From aea44561017ccfba58bd97741dde1508aa826a44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 5 Jul 2017 22:18:36 +0200 Subject: [PATCH] Better fix for sequencer crash when text strip doesn't have effect data. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This situation happens when a file with a text effect sequencer strip is loaded in Blender < 2.76 and saved. This destroys the effect data, causing a crash in Blender ≥ 2.76. d2f748a222ad19f prevented the crash when opening such a file, but accessing the strip still caused a crash. This commit fixes that by actually initialising the invalid strip. Of course this still causes data loss, but that already happened by opening & overwriting the file in Blender < 2.76. --- .../blenloader/intern/versioning_270.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 87ccfedcff3..94d335870ca 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1236,12 +1236,19 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) SEQ_BEGIN (scene->ed, seq) { - if (seq->type == SEQ_TYPE_TEXT) { - TextVars *data = seq->effectdata; - if (data != NULL && data->color[3] == 0.0f) { - copy_v4_fl(data->color, 1.0f); - data->shadow_color[3] = 1.0f; - } + if (seq->type != SEQ_TYPE_TEXT) { + continue; + } + + if (seq->effectdata == NULL) { + struct SeqEffectHandle effect_handle = BKE_sequence_get_effect(seq); + effect_handle.init(seq); + } + + TextVars *data = seq->effectdata; + if (data->color[3] == 0.0f) { + copy_v4_fl(data->color, 1.0f); + data->shadow_color[3] = 1.0f; } } SEQ_END -- 2.28.0