Fix T59365: Blender crashes when I try to open a .blend file.
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 14 Dec 2018 13:44:20 +0000 (14:44 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 14 Dec 2018 13:44:20 +0000 (14:44 +0100)
Broken logic in check for a valid vgroup storage pointer...

source/blender/modifiers/intern/MOD_array.c

index 597320c3887c0fc67ff3b07e525f246aad0d66e1..d14d8f2288e65c006919af53f59ec941258f7dd8 100644 (file)
@@ -279,7 +279,6 @@ static void mesh_merge_transform(
        MEdge *me;
        MLoop *ml;
        MPoly *mp;
-       MDeformVert *dvert;
 
        CustomData_copy_data(&cap_mesh->vdata, &result->vdata, 0, cap_verts_index, cap_nverts);
        CustomData_copy_data(&cap_mesh->edata, &result->edata, 0, cap_edges_index, cap_nedges);
@@ -295,9 +294,8 @@ static void mesh_merge_transform(
        }
 
        /* remap the vertex groups if necessary */
-       dvert = result->dvert + cap_verts_index;
-       if (dvert != NULL) {
-               BKE_object_defgroup_index_map_apply(dvert, cap_nverts, remap, remap_len);
+       if (result->dvert != NULL) {
+               BKE_object_defgroup_index_map_apply(&result->dvert[cap_verts_index], cap_nverts, remap, remap_len);
        }
 
        /* adjust cap edge vertex indices */