From 540de0d10f9f48297c43da9e23c0fa043a694b6a Mon Sep 17 00:00:00 2001 From: Groene AI <270696204+groeneai@users.noreply.github.com> Date: Mon, 5 Oct 2026 18:52:10 +0000 Subject: [PATCH] geometry: an empty linear geometry is disjoint from an areal one `disjoint_no_intersections_policy::apply` ignored the result of `point_on_border`, which does not write the point for an empty range, so `disjoint`/`intersects` of an empty linestring (or a multi-linestring with an empty element) and a ring/polygon/multi-polygon read an uninitialized point. Check the result as `point_on_border_covered_by` does for areal/areal. Co-Authored-By: Claude Opus 5.5 --- boost/geometry/algorithms/detail/disjoint/linear_areal.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp b/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp index 5c1008a14..822e8cf23 100644 --- a/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp +++ b/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp @@ -72,9 +72,8 @@ struct disjoint_no_intersections_policy static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, Strategy const& strategy) { typename helper_geometry>::type p; - geometry::point_on_border(p, g1); - - return ! geometry::covered_by(p, g2, strategy); + return ! (geometry::point_on_border(p, g1) + && geometry::covered_by(p, g2, strategy)); } };