summaryrefslogtreecommitdiffhomepage
path: root/spline/spline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'spline/spline.cpp')
-rw-r--r--spline/spline.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/spline/spline.cpp b/spline/spline.cpp
index eacf4feb..21044b34 100644
--- a/spline/spline.cpp
+++ b/spline/spline.cpp
@@ -213,6 +213,10 @@ void spline::update_interp_data() const
const unsigned x = unsigned(f(.5) * cf * (cx[0] + cx[1] * t + cx[2] * t2 + cx[3] * t3));
const float y = (float)(f(.5) * (cy[0] + cy[1] * t + cy[2] * t2 + cy[3] * t3));
+ int ret = std::fpclassify(y);
+ if (ret == FP_NAN || ret == FP_INFINITE)
+ continue;
+
if (x < value_count)
data[x] = y;
}