[Bf-blender-cvs] [1e5e65fa9f1] blender-v2.81-release: Fix T70695: Scene crashes Blender on open.

Bastien Montagne noreply at git.blender.org
Fri Oct 11 18:55:00 CEST 2019


Commit: 1e5e65fa9f142440689c474dd6d924ab884c7efb
Author: Bastien Montagne
Date:   Fri Oct 11 16:18:37 2019 +0200
Branches: blender-v2.81-release
https://developer.blender.org/rB1e5e65fa9f142440689c474dd6d924ab884c7efb

Fix T70695: Scene crashes Blender on open.

Note that this commit fixes the crash itself, but actual issue is *how*
that situation could happen (having insert override operation with local
'source' overriding data-block with an empty bone constraints stack...).

===================================================================

M	source/blender/makesrna/intern/rna_pose.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 0f8f8d39c41..8c4b7dd52d9 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -648,7 +648,7 @@ bool rna_PoseChannel_constraints_override_apply(Main *UNUSED(bmain),
 
   /* Remember that insertion operations are defined and stored in correct order, which means that
    * even if we insert several items in a row, we always insert first one, then second one, etc.
-   * So we should always find 'anchor' constraint in both _src *and* _dst> */
+   * So we should always find 'anchor' constraint in both _src *and* _dst */
   bConstraint *con_anchor = NULL;
   if (opop->subitem_local_name && opop->subitem_local_name[0]) {
     con_anchor = BLI_findstring(
@@ -669,7 +669,11 @@ bool rna_PoseChannel_constraints_override_apply(Main *UNUSED(bmain),
   }
   con_src = con_src ? con_src->next : pchan_src->constraints.first;
 
-  BLI_assert(con_src != NULL);
+  if (con_src == NULL) {
+    printf("%s: Could not find constraint to insert, doing nothing...\n", __func__);
+    BLI_assert(0);
+    return false;
+  }
 
   bConstraint *con_dst = BKE_constraint_duplicate_ex(con_src, 0, true);



More information about the Bf-blender-cvs mailing list