From c2a01a6c118ed03fa48aa4f537fe9e5cf711b536 Mon Sep 17 00:00:00 2001 From: Greg Neumiller Date: Mon, 7 Dec 2020 13:30:05 +1100 Subject: Fix T83347: Smart UV project crashes with wire edges Missing NULL check. Regression in 9296ba867462f7ff3c55bc0c9129af4121243bed Ref D9757 --- source/blender/editors/uvedit/uvedit_islands.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/uvedit') diff --git a/source/blender/editors/uvedit/uvedit_islands.c b/source/blender/editors/uvedit/uvedit_islands.c index 8a8259d335a..93948b5ae1b 100644 --- a/source/blender/editors/uvedit/uvedit_islands.c +++ b/source/blender/editors/uvedit/uvedit_islands.c @@ -144,18 +144,20 @@ static float (*bm_face_array_calc_unique_uv_coords( BMEdge *e_first = v_pivot->e; const BMEdge *e = e_first; do { - const BMLoop *l_radial = e->l; - do { - if (l_radial->v == l_iter->v) { - if (BM_elem_flag_test(l_radial, BM_ELEM_TAG)) { - const MLoopUV *luv_radial = BM_ELEM_CD_GET_VOID_P(l_radial, cd_loop_uv_offset); - if (equals_v2v2(luv->uv, luv_radial->uv)) { - /* Don't add this UV when met in another face in `faces`. */ - BM_elem_flag_disable(l_iter, BM_ELEM_TAG); + if (e->l != NULL) { + const BMLoop *l_radial = e->l; + do { + if (l_radial->v == l_iter->v) { + if (BM_elem_flag_test(l_radial, BM_ELEM_TAG)) { + const MLoopUV *luv_radial = BM_ELEM_CD_GET_VOID_P(l_radial, cd_loop_uv_offset); + if (equals_v2v2(luv->uv, luv_radial->uv)) { + /* Don't add this UV when met in another face in `faces`. */ + BM_elem_flag_disable(l_iter, BM_ELEM_TAG); + } } } - } - } while ((l_radial = l_radial->radial_next) != e->l); + } while ((l_radial = l_radial->radial_next) != e->l); + } } while ((e = BM_DISK_EDGE_NEXT(e, v_pivot)) != e_first); } while ((l_iter = l_iter->next) != l_first); } -- cgit v1.2.3