diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-04 11:48:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-04 11:48:41 +0300 |
commit | cb5ec7f7431d9720518ade17eee3c1ce9732e7de (patch) | |
tree | 79387c581f78b080e40e5512cb7546296890a274 /source | |
parent | 40f32f406bc19f78d4553d0be797eb94f0dac2a6 (diff) |
Fix use-after free (own error)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/operators/bmo_triangulate.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c index 986583cc21b..5e25f57a3d1 100644 --- a/source/blender/bmesh/operators/bmo_triangulate.c +++ b/source/blender/bmesh/operators/bmo_triangulate.c @@ -75,6 +75,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) GHash *sf_vert_map; float normal[3]; const int scanfill_flag = BLI_SCANFILL_CALC_HOLES | BLI_SCANFILL_CALC_POLYS | BLI_SCANFILL_CALC_LOOSE; + unsigned int nors_tot; bool calc_winding = false; sf_vert_map = BLI_ghash_ptr_new_ex(__func__, BMO_slot_buffer_count(op->slots_in, "edges")); @@ -103,6 +104,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) /* sf_edge = */ BLI_scanfill_edge_add(&sf_ctx, UNPACK2(sf_verts)); /* sf_edge->tmp.p = e; */ /* UNUSED */ } + nors_tot = BLI_ghash_size(sf_vert_map); BLI_ghash_free(sf_vert_map, NULL, NULL); @@ -111,7 +113,6 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) * Since we don't know winding, just accumulate */ ScanFillVert *sf_vert; struct SortNormal *nors; - const unsigned int nors_tot = BLI_ghash_size(sf_vert_map); unsigned int i; bool is_degenerate = true; |