Fix a couple of point cloud related problems

* crash that occurs when loading an empty dataset
* trying to access outside of range when sampling color or size values
This commit is contained in:
Emma Broman
2024-02-20 08:39:54 +01:00
parent 1b5335fa89
commit 8fddd55851
4 changed files with 12 additions and 2 deletions

View File

@@ -1072,12 +1072,12 @@ std::vector<float> RenderablePointCloud::createDataSlice() {
}
// Colors
if (_hasColorMapFile) {
if (_hasColorMapFile && colorParamIndex > -1) {
result.push_back(e.data[colorParamIndex]);
}
// Size data
if (_hasDatavarSize) {
if (_hasDatavarSize && sizeParamIndex > -1) {
// @TODO: Consider more detailed control over the scaling. Currently the value
// is multiplied with the value as is. Should have similar mapping properties
// as the color mapping