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
This commit is contained in:
Sergey Sharybin
2024-07-05 16:54:29 +02:00
committed by Sergey Sharybin
parent b33ad47ee0
commit e9d46b52df

View File

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