diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-10-27 13:22:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-10-30 06:26:57 +0300 |
commit | ca495381c566b31ab8edc387dc7f21e9b5f90a5d (patch) | |
tree | 983e8ea0dfbeea53e43b50085b0bb97e7cecdbe8 /source/blender/editors | |
parent | bed3cbdf3d88a61cf081941c0fd96205f47ecee7 (diff) |
Missing NULL pointer check in poly-build tool
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_polybuild.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/editors/mesh/editmesh_polybuild.c b/source/blender/editors/mesh/editmesh_polybuild.c index 6600874655b..bfabd64396f 100644 --- a/source/blender/editors/mesh/editmesh_polybuild.c +++ b/source/blender/editors/mesh/editmesh_polybuild.c @@ -126,20 +126,22 @@ static int edbm_polybuild_face_at_cursor_invoke( BMVert *v_act = (BMVert *)ele_act; BMEdge *e_pair[2] = {NULL}; - for (uint allow_wire = 0; allow_wire < 2 && (e_pair[1] == NULL); allow_wire++) { - int i = 0; - BMEdge *e_iter = v_act->e; - do { - if ((BM_elem_flag_test(e_iter, BM_ELEM_HIDDEN) == false) && - (allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter))) - { - if (i == 2) { - e_pair[0] = e_pair[1] = NULL; - break; + if (v_act->e != NULL) { + for (uint allow_wire = 0; allow_wire < 2 && (e_pair[1] == NULL); allow_wire++) { + int i = 0; + BMEdge *e_iter = v_act->e; + do { + if ((BM_elem_flag_test(e_iter, BM_ELEM_HIDDEN) == false) && + (allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter))) + { + if (i == 2) { + e_pair[0] = e_pair[1] = NULL; + break; + } + e_pair[i++] = e_iter; } - e_pair[i++] = e_iter; - } - } while ((e_iter = BM_DISK_EDGE_NEXT(e_iter, v_act)) != v_act->e); + } while ((e_iter = BM_DISK_EDGE_NEXT(e_iter, v_act)) != v_act->e); + } } if (e_pair[1] != NULL) { |