patch to guard against bad return numbers
This commit is contained in:
parent
308940c460
commit
948f6b0739
|
@ -0,0 +1,14 @@
|
|||
diff --git a/io/private/las/Summary.cpp b/io/private/las/Summary.cpp
|
||||
index e9232d4806..91059bfaf9 100644
|
||||
--- a/io/private/las/Summary.cpp
|
||||
+++ b/io/private/las/Summary.cpp
|
||||
@@ -57,7 +57,8 @@ void Summary::addPoint(double x, double y, double z, int returnNumber)
|
||||
m_bounds.grow(x, y, z);
|
||||
|
||||
// Returns numbers are indexed from one, but the array indexes from 0.
|
||||
- m_returnCounts[returnNumber - 1]++;
|
||||
+ if (returnNumber >= 1 && returnNumber <= m_returnCounts.size())
|
||||
+ m_returnCounts[returnNumber - 1]++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue