Fix T84529: Crash with strip using deleted scene

If scene strip has no scene assigned, leave source string empty.
Same goes for all other strips, that use ID datablocks.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10058
This commit is contained in:
Peter Fog 2021-01-10 17:18:50 +01:00 committed by Richard Antalik
parent e45630a99f
commit 544e371908
Notes: blender-bot 2023-02-13 22:20:49 +01:00
Referenced by issue #84529, Crash when having a scene strip in VSE that references a scene that has been deleted
1 changed files with 6 additions and 8 deletions

View File

@ -627,10 +627,8 @@ static void draw_seq_text_get_source(Sequence *seq, char *r_source, size_t sourc
if (ELEM(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE)) {
BLI_snprintf(r_source, source_len, "%s%s", seq->strip->dir, seq->strip->stripdata->name);
}
else if (seq->type == SEQ_TYPE_SOUND_RAM) {
if (seq->sound) {
BLI_snprintf(r_source, source_len, "%s", seq->sound->filepath);
}
else if (seq->type == SEQ_TYPE_SOUND_RAM && seq->sound != NULL) {
BLI_snprintf(r_source, source_len, "%s", seq->sound->filepath);
}
else if (seq->type == SEQ_TYPE_MULTICAM) {
BLI_snprintf(r_source, source_len, "Channel: %d", seq->multicam_source);
@ -639,8 +637,8 @@ static void draw_seq_text_get_source(Sequence *seq, char *r_source, size_t sourc
TextVars *textdata = seq->effectdata;
BLI_snprintf(r_source, source_len, "%s", textdata->text);
}
else if (seq->type == SEQ_TYPE_SCENE) {
if (seq->scene_camera) {
else if (seq->type == SEQ_TYPE_SCENE && seq->scene != NULL) {
if (seq->scene_camera && seq->scene_camera != NULL) {
BLI_snprintf(r_source,
source_len,
"%s (%s)",
@ -651,10 +649,10 @@ static void draw_seq_text_get_source(Sequence *seq, char *r_source, size_t sourc
BLI_snprintf(r_source, source_len, "%s", seq->scene->id.name + 2);
}
}
else if (seq->type == SEQ_TYPE_MOVIECLIP) {
else if (seq->type == SEQ_TYPE_MOVIECLIP && seq->clip != NULL) {
BLI_snprintf(r_source, source_len, "%s", seq->clip->id.name + 2);
}
else if (seq->type == SEQ_TYPE_MASK) {
else if (seq->type == SEQ_TYPE_MASK && seq->mask != NULL) {
BLI_snprintf(r_source, source_len, "%s", seq->mask->id.name + 2);
}
else {