[Liblas-commits] hg: apply a variation on the fix for #206
liblas-commits at liblas.org
liblas-commits at liblas.org
Thu Jan 20 15:21:10 EST 2011
details: http://hg.liblas.orghg/rev/614df6944ee9
changeset: 2801:614df6944ee9
user: Howard Butler <hobu.inc at gmail.com>
date: Thu Jan 20 14:20:58 2011 -0600
description:
apply a variation on the fix for #206
diffstat:
src/detail/reader/header.cpp | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diffs (27 lines):
diff -r 8b8755be3764 -r 614df6944ee9 src/detail/reader/header.cpp
--- a/src/detail/reader/header.cpp Thu Jan 20 11:03:28 2011 -0800
+++ b/src/detail/reader/header.cpp Thu Jan 20 14:20:58 2011 -0600
@@ -231,19 +231,13 @@
// A few versions of the spec had this as 7, but
// https://lidarbb.cr.usgs.gov/index.php?showtopic=11388 says
// it is supposed to always be 5
- std::vector<uint32_t>::size_type return_count_length;
- return_count_length = 5;
-
- uint32_t* point_counts = new uint32_t[return_count_length];
- for (uint32_t i = 0; i < return_count_length; ++i) {
- point_counts[i] = 0;
- }
- read_n(point_counts, m_ifs, return_count_length*sizeof(uint32_t));
+ std::size_t const return_count_length = 5;
for (std::size_t i = 0; i < return_count_length; ++i)
{
- m_header->SetPointRecordsByReturnCount(i, point_counts[i]);
+ uint32_t count = 0;
+ read_n(count, m_ifs, sizeof(uint32_t));
+ m_header->SetPointRecordsByReturnCount(i, count);
}
- delete[] point_counts;
// 21-23. Scale factors
read_n(x1, m_ifs, sizeof(x1));
More information about the Liblas-commits
mailing list