diff --git a/src/tinyspline.c b/src/tinyspline.c index 82cfa4806..4d77c5066 100755 --- a/src/tinyspline.c +++ b/src/tinyspline.c @@ -463,8 +463,9 @@ void ts_internal_deboornet_new(const tsBSpline *spline, { const size_t dim = ts_bspline_dimension(spline); const size_t deg = ts_bspline_degree(spline); - const size_t num_points = (size_t)(deg * (deg+1) * 0.5f); - /* Handle case deg <= 1 which generates too few points. */ + const size_t order = ts_bspline_order(spline); + const size_t num_points = (size_t)(order * (order+1) * 0.5f); + /* Handle case order == 1 which generates too few points. */ const size_t fixed_num_points = num_points < 2 ? 2 : num_points; const size_t sof_real = sizeof(tsReal);