From 066c6f3674ee9a097cfdc1330ef5d45265e4c021 Mon Sep 17 00:00:00 2001
From: Campbell Barton <campbell@blender.org>
Date: Tue, 29 Oct 2024 14:36:13 +1100
Subject: [PATCH] Fix UBSAN warning caused by uninitialized memory use

Unwrapping warned that a non 0/1 boolean value was being set.

Initialize all members of PVert since they would be accessed
when duplicating a PVert causing the uninitialized memory to be read.
---
 source/blender/geometry/intern/uv_parametrizer.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source/blender/geometry/intern/uv_parametrizer.cc b/source/blender/geometry/intern/uv_parametrizer.cc
index 83025192d3c..0de4e58ea89 100644
--- a/source/blender/geometry/intern/uv_parametrizer.cc
+++ b/source/blender/geometry/intern/uv_parametrizer.cc
@@ -730,6 +730,10 @@ static PVert *p_vert_add(
   v->edge = e;
   v->flag = 0;
 
+  /* Unused, prevent uninitialized memory access on duplication. */
+  v->on_boundary_flag = false;
+  v->slim_id = 0;
+
   phash_insert(handle->hash_verts, (PHashLink *)v);
 
   return v;
-- 
GitLab