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>2013-03-16 18:18:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-16 18:18:32 +0400
commita7b83837db63c799c05b257c67db9d980a1650eb (patch)
treefad78df7761ba852b62d290e1c2b2413b86b9290 /source/blender/bmesh/intern/bmesh_queries.c
parent5bea78301dcb0af8b6298abc5554643364c667dc (diff)
fix for crash when using BM_face_calc_tessellation(), its not ensured that all tris will be filled in.
(effected knife project and laplacian smooth).
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_queries.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c
index 0525337120f..26b0e42a1c1 100644
--- a/source/blender/bmesh/intern/bmesh_queries.c
+++ b/source/blender/bmesh/intern/bmesh_queries.c
@@ -1657,12 +1657,13 @@ bool BM_face_is_any_edge_flag_test(BMFace *f, const char hflag)
static void bm_mesh_calc_volume_face(BMFace *f, float *r_vol)
{
- const int tottri = f->len - 2;
+ int tottri = f->len - 2;
BMLoop **loops = BLI_array_alloca(loops, f->len);
int (*index)[3] = BLI_array_alloca(index, tottri);
int j;
- BM_face_calc_tessellation(f, loops, index);
+ tottri = BM_face_calc_tessellation(f, loops, index);
+ BLI_assert(tottri <= f->len - 2);
for (j = 0; j < tottri; j++) {
const float *p1 = loops[index[j][0]]->v->co;