Fix T83347: Smart UV project crashes with wire edges

Missing NULL check.
Regression in 9296ba8674

Ref D9757
This commit is contained in:
Greg Neumiller 2020-12-07 13:30:05 +11:00 committed by Campbell Barton
parent fff0032a25
commit c2a01a6c11
Notes: blender-bot 2023-02-14 10:37:50 +01:00
Referenced by issue #84785, UV > Pack Islands causes crash (with and without multi-editing) on blender 2.91.0 ubuntu
Referenced by issue #83430, UV Pack Islands causes crash 2.91
Referenced by issue #83347, Smart UV Project crashes Blender 2.91
Referenced by issue #83216, Potential candidates for corrective releases
1 changed files with 12 additions and 10 deletions

View File

@ -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);
}