summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Matherly <code@brianmatherly.com>2016-03-15 06:36:37 (GMT)
committer Brian Matherly <code@brianmatherly.com>2016-03-15 06:36:37 (GMT)
commita22e0062c75d57074e0df14afb66a7b765bf0c67 (patch)
treedf7a20c734fc75a93aef9c8c0e708daea4f226c6
parent954fbe3e324e05f36aa1ae84f7fed4f87d6c9176 (diff)
Fix range checking on ndvi.
-rw-r--r--src/filter/ndvi/ndvi.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/filter/ndvi/ndvi.cpp b/src/filter/ndvi/ndvi.cpp
index b7054b7..8c35cef 100644
--- a/src/filter/ndvi/ndvi.cpp
+++ b/src/filter/ndvi/ndvi.cpp
@@ -160,6 +160,8 @@ void Ndvi::update(double time,
void Ndvi::initLut() {
// Only update the LUT if a parameter has changed.
unsigned int paramLutLevelsInt = paramLutLevels * 1000.0 + 0.5;
+ if (paramLutLevelsInt < 2) paramLutLevelsInt = 2;
+ if (paramLutLevelsInt > 1000) paramLutLevelsInt = 1000;
if (lutLevels == paramLutLevelsInt &&
colorMap == paramColorMap) {
return;