diff --git a/include/pdal/filters/HexBin.hpp b/include/pdal/filters/HexBin.hpp index c522c4639b..29174cab7f 100644 --- a/include/pdal/filters/HexBin.hpp +++ b/include/pdal/filters/HexBin.hpp @@ -107,6 +107,10 @@ class PDAL_DLL IteratorBase boost::uint32_t m_sample_number; boost::int32_t m_density; double m_edge_size; + +private: + IteratorBase& operator=(IteratorBase const&); + }; diff --git a/src/filters/HexBin.cpp b/src/filters/HexBin.cpp index c5d07dc563..87c241340e 100644 --- a/src/filters/HexBin.cpp +++ b/src/filters/HexBin.cpp @@ -163,7 +163,15 @@ boost::uint32_t HexBin::readBufferImpl(PointBuffer& buffer) if (bDoSample) { if (getStage().getNumPoints() < m_sample_size) - m_sample_size = getStage().getNumPoints(); + { + if (getStage().getNumPoints() >= std::numeric_limits::max()) + { + throw pdal_error("point count >= size of 32bit integer, set a sample size"); + } + + m_sample_size = static_cast(getStage().getNumPoints()); + } + if ( m_sample_number < m_sample_size ) { m_samples.push_back(hexer::Point(x,y));