Added max points limit in one coastline piece (10000) to avoid infinite indexing

This commit is contained in:
Alex Zolotarev 2011-02-06 20:36:02 +02:00 committed by Alex Zolotarev
parent 58b0bd4baf
commit 02be5af144

View file

@ -2,6 +2,8 @@
//#include "../base/logging.hpp"
#define MAX_MERGED_POINTS_COUNT 10000
FeatureBuilder1Merger::FeatureBuilder1Merger(FeatureBuilder1 const & fb)
: FeatureBuilder1(fb)
{
@ -17,6 +19,12 @@ bool FeatureBuilder1Merger::MergeWith(FeatureBuilder1 const & fb)
if (fb.m_Types != m_Types)
return false;
// do not create too long features
if (m_Geometry.size() > MAX_MERGED_POINTS_COUNT)
return false;
if (fb.m_Geometry.size() > MAX_MERGED_POINTS_COUNT)
return false;
// check last-first points equality
//if (m2::AlmostEqual(m_Geometry.back(), fb.m_Geometry.front()))
if (m_Geometry.back() == fb.m_Geometry.front())