[Bf-blender-cvs] [29b3035a542] blender-v2.91-release: Fix T83347: Smart UV project crashes with wire edges

Greg Neumiller noreply at git.blender.org
Wed Jan 13 15:08:46 CET 2021


Commit: 29b3035a542c6441512607ae592b333fd5a906d8
Author: Greg Neumiller
Date:   Mon Dec 7 13:30:05 2020 +1100
Branches: blender-v2.91-release
https://developer.blender.org/rB29b3035a542c6441512607ae592b333fd5a906d8

Fix T83347: Smart UV project crashes with wire edges

Missing NULL check.
Regression in 9296ba867462f7ff3c55bc0c9129af4121243bed

Ref D9757

===================================================================

M	source/blender/editors/uvedit/uvedit_islands.c

===================================================================

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



More information about the Bf-blender-cvs mailing list