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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-11-22 16:27:02 +0300
committerBastien Montagne <bastien@blender.org>2021-11-22 16:29:55 +0300
commit1d8d6c2f62bf0ee67e037397cb1ae8380e99c835 (patch)
tree434c5acae57eaa10009851c914c7d4137e73cc8f /source
parent0b89b94947f7b51c8641213fb69819c72f60f00a (diff)
Fix potential crash opening 3.0 blend files in older versions.
Affects insertion of constraints or NLA tracks in liboverrides. In some cases, when opening newer post-3.0 .blend files, the source won't be found anymore, override apply code then needs to fail properly instead of crashing. Related to refactor from rB33c5e7bcd5e5.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_animation.c5
-rw-r--r--source/blender/makesrna/intern/rna_object.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 10f86fe2671..d3580b901c0 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -775,7 +775,10 @@ bool rna_NLA_tracks_override_apply(Main *bmain,
}
nla_track_src = nla_track_src ? nla_track_src->next : anim_data_src->nla_tracks.first;
- BLI_assert(nla_track_src != NULL);
+ if (nla_track_src == NULL) {
+ BLI_assert(nla_track_src != NULL);
+ return false;
+ }
NlaTrack *nla_track_dst = BKE_nlatrack_copy(bmain, nla_track_src, true, 0);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 6b93a1c223c..481d4c1c7e9 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1601,7 +1601,10 @@ bool rna_Object_constraints_override_apply(Main *UNUSED(bmain),
}
con_src = con_src ? con_src->next : ob_src->constraints.first;
- BLI_assert(con_src != NULL);
+ if (con_src == NULL) {
+ BLI_assert(con_src != NULL);
+ return false;
+ }
bConstraint *con_dst = BKE_constraint_duplicate_ex(con_src, 0, true);