[Bf-blender-cvs] [b198cef89fa] master: Fix T74516: Armature Crash on Select Similar Group

Dalai Felinto noreply at git.blender.org
Wed Mar 11 15:32:34 CET 2020


Commit: b198cef89fa4a173580e8745dee051f37d1927c8
Author: Dalai Felinto
Date:   Wed Mar 11 15:30:24 2020 +0100
Branches: master
https://developer.blender.org/rBb198cef89fa4a173580e8745dee051f37d1927c8

Fix T74516: Armature Crash on Select Similar Group

Select Similar Group and Select Similar Shape had this issue since they
were added. Basically it assumes there is pose data which in some cases
it does not.

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

M	source/blender/editors/armature/armature_select.c

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

diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 0f288c0d8b8..47eb09cdf3d 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -1461,6 +1461,13 @@ static void select_similar_data_pchan(bContext *C, const size_t bytes_size, cons
   EditBone *ebone_act = CTX_data_active_bone(C);
 
   const bPoseChannel *pchan_active = BKE_pose_channel_find_name(obedit->pose, ebone_act->name);
+
+  /* This will mostly happen for corner cases where the user tried to access this
+   * before having any valid pose data for the armature. */
+  if (pchan_active == NULL) {
+    return;
+  }
+
   const char *data_active = (const char *)POINTER_OFFSET(pchan_active, offset);
   for (EditBone *ebone = arm->edbo->first; ebone; ebone = ebone->next) {
     if (EBONE_SELECTABLE(arm, ebone)) {



More information about the Bf-blender-cvs mailing list