diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-07-11 21:52:43 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-07-11 21:52:43 +0400 |
commit | db1ab7b1505b630878e527a03b3b3e0b77f590fc (patch) | |
tree | 561f2c390651aa345b4bbe13fe197eba6a9bce68 /source | |
parent | 4097f9c3c48bcf2df25451c1003f43e8fc0154f3 (diff) |
Fix potential bug in loop normals code.
Even if we cannot use computed lnor, we still have to empty the fan stack of lnors!
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_evaluate.c | 4 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index 7e547ec4c25..a9462aefa25 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -567,6 +567,10 @@ void BKE_mesh_normals_loop_split(MVert *mverts, const int UNUSED(numVerts), MEdg copy_v3_v3(nor, lnor); } } + else { + /* We still have to clear the stack! */ + while (BLI_SMALLSTACK_POP(normal)); + } } ml_prev = ml_curr; diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index e66d1263578..c996a5bb6a8 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -641,6 +641,10 @@ static void bm_mesh_loops_calc_normals(BMesh *bm, const float (*vcos)[3], const copy_v3_v3(nor, lnor); } } + else { + /* We still have to clear the stack! */ + while (BLI_SMALLSTACK_POP(normal)); + } } } while ((l_curr = l_curr->next) != l_first); } |