Commit 35906587 authored by Sergey Fedoseev's avatar Sergey Fedoseev Committed by Dan Baston

Fix #928: Fixed crash in GEOSUnaryUnion() when used with empty linestring.

parent 0680a657
Pipeline #30987652 failed with stage
in 9 minutes and 3 seconds
Changes in 3.6.4
2018-XX-XX
- Bug fixes / improvements
- Fix crash in GEOSUnaryUnion with empty LineString
(#928, Sergey Fedoseev)
Changes in 3.6.3
2018-08-06
......
......@@ -93,7 +93,9 @@ UnaryUnionOp::Union()
*/
unionLines.reset( CascadedUnion::Union( lines.begin(),
lines.end() ) );
unionLines = unionNoOpt(*unionLines);
if (unionLines.get()) {
unionLines = unionNoOpt(*unionLines);
}
}
GeomAutoPtr unionPolygons;
......
......@@ -207,5 +207,18 @@ namespace tut
}
// Self-union an empty linestring
template<>
template<>
void object::test<10>()
{
geom1_ = GEOSGeomFromWKT("LINESTRING EMPTY");
ensure( nullptr != geom1_ );
geom2_ = GEOSUnaryUnion(geom1_);
ensure( nullptr != geom2_ );
ensure_equals(toWKT(geom2_), std::string("GEOMETRYCOLLECTION EMPTY"));
}
} // namespace tut
......@@ -179,5 +179,17 @@ namespace tut
doTest(geoms, "MULTILINESTRING ((0 0, 5 0), (5 0, 10 0, 5 -5, 5 0), (5 0, 5 5))");
}
template<>
template<>
void object::test<7>()
{
static char const* const geoms[] =
{
"LINESTRING EMPTY",
nullptr
};
doTest(geoms, "GEOMETRYCOLLECTION EMPTY");
}
} // namespace tut
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment