Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion api/bag_georefmetadatalayerdescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,13 @@ std::shared_ptr<GeorefMetadataLayerDescriptor> GeorefMetadataLayerDescriptor::op
hsize_t numFields = 0;
fileDataSpace.getSimpleExtentDims(&numFields, nullptr);

const auto attrDataType = attribute.getDataType();
if (attribute.getStorageSize() != numFields * attrDataType.getSize())
throw InvalidValueSize{};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use curly braces, even for a single-line if statement, or place on a single line (yes, I know, other parts of the codebase don't do this, but I want to make sure new code does).


RecordDefinition definition(numFields);

attribute.read(attribute.getDataType(), definition.data());
attribute.read(attrDataType, definition.data());

// Determine chunk size and compression level.
const auto chunkSize = BAG::getChunkSize(h5file, internalPath);
Expand Down
Loading