summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Dennedy <dan@dennedy.org>2016-03-16 03:09:03 (GMT)
committer Dan Dennedy <dan@dennedy.org>2016-03-16 03:09:03 (GMT)
commitb105f7997971d438f9319a610a1ee389c29fa24e (patch)
treedf7a20c734fc75a93aef9c8c0e708daea4f226c6
parent954fbe3e324e05f36aa1ae84f7fed4f87d6c9176 (diff)
parenta22e0062c75d57074e0df14afb66a7b765bf0c67 (diff)
Merge pull request #6 from bmatherly/master
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;