[Bf-blender-cvs] [34902f20089] master: Fix crash exiting edit-mode with an active basis shape key

Campbell Barton noreply at git.blender.org
Wed Nov 27 18:30:28 CET 2019


Commit: 34902f200890d812edfd96e838e03241f5b3eedc
Author: Campbell Barton
Date:   Thu Nov 28 04:16:38 2019 +1100
Branches: master
https://developer.blender.org/rB34902f200890d812edfd96e838e03241f5b3eedc

Fix crash exiting edit-mode with an active basis shape key

Exposed by T71865, while the bug remains this resolves the crash.

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

M	source/blender/bmesh/intern/bmesh_mesh_conv.c

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

diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c
index 9bab959f0a2..5f0c673b379 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_conv.c
+++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c
@@ -879,7 +879,7 @@ void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMesh
         BM_ITER_MESH_INDEX (eve, &iter, bm, BM_VERTS_OF_MESH, i) {
           const int keyi = BM_ELEM_CD_GET_INT(eve, cd_shape_keyindex_offset);
 
-          if (keyi != ORIGINDEX_NONE) {
+          if (keyi != ORIGINDEX_NONE && keyi < actkey->totelem) {
             sub_v3_v3v3(ofs[i], mvert->co, fp[keyi]);
           }
           else {



More information about the Bf-blender-cvs mailing list