From e9d46b52dfef242ee0455b370600297adb59eaaa Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 5 Jul 2024 16:54:29 +0200 Subject: [PATCH] Fix #124109: Blender Crash on certain verticles in Dyntopo Caused by 396ad5db83 It is possible that some edge collapsing of non-manifold mesh will eventually result in extra wire edges, and loose vertices. This was not properly handled in the boundary checks, assuming that all modifications preserve mesh manifold. This fix avoids the crash by adding nullptr check in the boundary check. While this is not fully ideal from the result perspective, it is a safe change for 4.2. Ideally the wire edges and loose vertices will be removed, but this is a bigger and more risky change. Also, in Blender 4.0 it was possible to generate loose geometry in dyntopo as well, so it just a general improvement to happen (and not a regression). Pull Request: https://projects.blender.org/blender/blender/pulls/124236 --- source/blender/blenkernel/intern/pbvh_bmesh.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.cc b/source/blender/blenkernel/intern/pbvh_bmesh.cc index ebfda3d5010..0f22ca6b37c 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.cc +++ b/source/blender/blenkernel/intern/pbvh_bmesh.cc @@ -790,6 +790,9 @@ static bool is_boundary_vert(const BMVert &vertex) { BMEdge *edge = vertex.e; BMEdge *first_edge = edge; + if (first_edge == nullptr) { + return false; + } do { if (is_boundary_edge(*edge)) { return true;