diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2013-09-03 15:37:47 +0400 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2013-09-03 15:37:47 +0400 |
commit | aa3bea133a72353d800c7184e4c3e4a96058a41e (patch) | |
tree | 29f07ab49769edf009611823f3f0f6ae8d616114 /source/blender/editors/mesh | |
parent | 92fbc1e250c978daa9e67162f00fffa92a88a2f6 (diff) |
Fix a possible bug in knife detected by coverity.
A selection copy may have been passed a null pointer.
Also quieted a couple other complaints by coverity.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 70bfd6fac6d..1d73861c453 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1320,6 +1320,7 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree, hit.kfe = kfe; hit.v = NULL; + hit.l = 0.0f; knife_find_basef(kfe); hit.f = kfe->basef; @@ -1694,7 +1695,7 @@ static KnifeEdge *knife_find_closest_edge(KnifeTool_OpData *kcd, float p[3], flo if (fptr) *fptr = f; - if (cure && p) { + if (cure) { if (!kcd->ignore_edge_snapping || !(cure->e)) { KnifeVert *edgesnap = NULL; @@ -1787,7 +1788,7 @@ static KnifeVert *knife_find_closest_vert(KnifeTool_OpData *kcd, float p[3], flo if (fptr) *fptr = f; - if (curv && p) { + if (curv) { copy_v3_v3(p, curv->co); copy_v3_v3(cagep, curv->cageco); @@ -2725,7 +2726,7 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha BM_edge_select_set(bm, l_new->e, true); } } - else { + else if (f_new) { BM_elem_select_copy(bm, bm, f_new, f); } |