diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-03-13 11:35:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-03-13 11:41:44 +0400 |
commit | 702f374972ed97392ab2d03ec46434092ad9fca8 (patch) | |
tree | 59ae345228c514848e4f60d89cd26d585ba86e82 /source/blender/bmesh/intern | |
parent | e6a359a0a9ec5884887a6a257d979d131f582816 (diff) |
Fix for possible (unlikely) uninitialized var use in BM_face_split
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mods.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index a7e3c12e5d7..9696eb69165 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -281,11 +281,12 @@ BMFace *BM_face_split(BMesh *bm, BMFace *f, BLI_assert(!BM_loop_is_adjacent(l_a, l_b)); /* could be an assert */ - if (UNLIKELY(BM_loop_is_adjacent(l_a, l_b))) { - return NULL; - } - - if (f != l_a->f || f != l_b->f) { + if (UNLIKELY(BM_loop_is_adjacent(l_a, l_b)) || + UNLIKELY((f != l_a->f || f != l_b->f))) + { + if (r_l) { + *r_l = NULL; + } return NULL; } @@ -368,11 +369,12 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f, BLI_assert(!((n == 0) && BM_loop_is_adjacent(l_a, l_b))); /* could be an assert */ - if (UNLIKELY((n == 0) && BM_loop_is_adjacent(l_a, l_b))) { - return NULL; - } - - if (l_a->f != l_b->f) { + if (UNLIKELY((n == 0) && BM_loop_is_adjacent(l_a, l_b)) || + UNLIKELY(l_a->f != l_b->f)) + { + if (r_l) { + *r_l = NULL; + } return NULL; } @@ -495,12 +497,13 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, float if (BLI_array_count(faces) >= 2) { BMFace *f2 = BM_faces_join(bm, faces, BLI_array_count(faces), true); if (f2) { - BMLoop *l_new = NULL; BMLoop *l_a, *l_b; if ((l_a = BM_face_vert_share_loop(f2, tv)) && (l_b = BM_face_vert_share_loop(f2, tv2))) { + BMLoop *l_new; + if (BM_face_split(bm, f2, l_a, l_b, &l_new, NULL, false)) { e_new = l_new->e; } |