From a7b21a989096f4dd790d38a4381c0d68a74eba4c Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 3 Mar 2020 15:52:49 +0100 Subject: [PATCH] Fallback interpolator to lerp if not enough points --- src/sfizz/Curve.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sfizz/Curve.cpp b/src/sfizz/Curve.cpp index 01f121a6..0c077b1a 100644 --- a/src/sfizz/Curve.cpp +++ b/src/sfizz/Curve.cpp @@ -159,6 +159,9 @@ void Curve::splineFill(const bool fillStatus[NumValues]) } } + if (count < 3) + return lerpFill(fillStatus); + Spline spline(x.data(), y.data(), count); for (unsigned i = 0; i < NumValues; ++i) { if (!fillStatus[i])