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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-12-19 05:24:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-19 05:24:12 +0400
commitf6c5a72e3f73c03f152ddd74e6aa5e11280ed7a0 (patch)
tree89a18678dbf99a4606349099de5b1453de7dad7b /source/blender/bmesh/intern
parentf10dea7e3b9b431edae9c787fa1a9e09cd567ed7 (diff)
fix [#33606] Adding the Decimate modifier will crash Blender
own regression since 2.65 release.
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r--source/blender/bmesh/intern/bmesh_construct.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c
index e12110b31ca..87192d6610f 100644
--- a/source/blender/bmesh/intern/bmesh_construct.c
+++ b/source/blender/bmesh/intern/bmesh_construct.c
@@ -173,8 +173,8 @@ void BM_face_copy_shared(BMesh *bm, BMFace *f)
*/
BMFace *BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, int len, const int create_flag)
{
- BMEdge **edges2 = BLI_array_alloca_and_count(edges2, len);
- BMVert **verts = BLI_array_alloca_and_count(verts, len + 1);
+ BMEdge **edges2 = BLI_array_alloca(edges2, len);
+ BMVert **verts = BLI_array_alloca(verts, len + 1);
int e2_index = 0;
int v_index = 0;
@@ -235,7 +235,7 @@ BMFace *BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, i
e = e2;
} while (e != edges[0]);
- if (BLI_array_count(edges2) != len) {
+ if (e2_index != len) {
goto err; /* we didn't use all edges in forming the boundary loop */
}
@@ -296,10 +296,9 @@ BMFace *BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, i
err:
for (i = 0; i < len; i++) {
BM_ELEM_API_FLAG_DISABLE(edges[i], _FLAG_MF);
- /* vert count may != len */
- if (i < BLI_array_count(verts)) {
- BM_ELEM_API_FLAG_DISABLE(verts[i], _FLAG_MV);
- }
+ }
+ for (i = 0; i < v_index; i++) {
+ BM_ELEM_API_FLAG_DISABLE(verts[i], _FLAG_MV);
}
return NULL;