From 2cb8aed9d4d8d791c1e6f6df1d28cbd93ca39d16 Mon Sep 17 00:00:00 2001 From: Russell Morris Date: Mon, 21 Apr 2025 13:31:24 -0600 Subject: [PATCH 1/2] Avoid NULL deref in KillFace() from tessMeshConnect(). --- Source/mesh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/mesh.c b/Source/mesh.c index 763feca..88671d8 100755 --- a/Source/mesh.c +++ b/Source/mesh.c @@ -494,6 +494,7 @@ TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge eNewSym = eNew->Sym; if( eDst->Lface != eOrg->Lface ) { + if (eDst->Lface == NULL) return NULL; /* We are connecting two disjoint loops -- destroy eDst->Lface */ joiningLoops = TRUE; KillFace( mesh, eDst->Lface, eOrg->Lface ); From 39066b40bc09e9168f165a3081889e1e6526e0a2 Mon Sep 17 00:00:00 2001 From: Russell Morris Date: Thu, 24 Apr 2025 11:38:49 -0600 Subject: [PATCH 2/2] Revert "Avoid NULL deref in KillFace() from tessMeshConnect()." This reverts commit 2cb8aed9d4d8d791c1e6f6df1d28cbd93ca39d16. --- Source/mesh.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/mesh.c b/Source/mesh.c index 88671d8..763feca 100755 --- a/Source/mesh.c +++ b/Source/mesh.c @@ -494,7 +494,6 @@ TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge eNewSym = eNew->Sym; if( eDst->Lface != eOrg->Lface ) { - if (eDst->Lface == NULL) return NULL; /* We are connecting two disjoint loops -- destroy eDst->Lface */ joiningLoops = TRUE; KillFace( mesh, eDst->Lface, eOrg->Lface );