Skip to content

Commit

Permalink
Multiple extrabytes definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed Jul 29, 2024
1 parent 8b8a877 commit c6689ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### rlas v1.8.2

- Fix: can read file with multiple extra bytes definitions

### rlas v1.8.1

- Removed a `boost` header still included in the code.
Expand Down
13 changes: 12 additions & 1 deletion src/LASlib/lasreader_las.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,18 @@ BOOL LASreaderLAS::open(ByteStreamIn* stream, BOOL peek_only, U32 decompress_sel
}
else if (header.vlrs[i].record_id == 4) // ExtraBytes
{
header.init_attributes(header.vlrs[i].record_length_after_header/sizeof(LASattribute), (LASattribute*)header.vlrs[i].data);
if (header.attribute_sizes == 0)
{
header.init_attributes(header.vlrs[i].record_length_after_header/sizeof(LASattribute), (LASattribute*)header.vlrs[i].data);
}
else
{
U32 number_attributes = header.vlrs[i].record_length_after_header/sizeof(LASattribute);
LASattribute* attributes = (LASattribute*)header.vlrs[i].data;
for (j = 0; j < (U32)number_attributes; j++)
header.add_attribute(attributes[j]);
}

for (j = 0; j < (U32)header.number_attributes; j++)
{
if (header.attributes[j].data_type > 10)
Expand Down

0 comments on commit c6689ed

Please sign in to comment.