avoid crashing if vn<100

This commit is contained in:
Marco Callieri 2017-03-23 14:51:20 +01:00
parent 79f2fc9e73
commit 77bbf1d70c
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ public:
// tree.setMaxNofNeighbors(nn);
const ScalarType maxDistSquared = maxDist*maxDist;
int cnt=0;
int step=m.vn/100;
int step = max(m.vn, int(m.vn / 100));
typename KdTree<ScalarType>::PriorityQueue nq;
for (VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi)
{