VOXCONVERT: clamp the maxdepth value

master
Martin Gerhardy 2022-04-29 17:21:36 +02:00
parent 42174b9a86
commit 932a65d857
1 changed files with 1 additions and 1 deletions

View File

@ -409,7 +409,7 @@ bool VoxConvert::handleInputFile(const core::String &infile, voxelformat::SceneG
}
if (importAsVolume) {
voxelformat::SceneGraphNode node;
const int maxDepth = core::string::toInt(getArgVal("--image-as-volume-max-depth"));
const int maxDepth = glm::clamp(core::string::toInt(getArgVal("--image-as-volume-max-depth")), 1, 255);
const bool bothSides = core::string::toBool(getArgVal("--image-as-volume-both-sides"));
node.setVolume(voxelutil::importAsVolume(image, maxDepth, bothSides), true);
node.setName(infile);