msteinbeck / tinyspline

ANSI C library for NURBS, B-Splines, and Bézier curves with interfaces for C++, C#, D, Go, Java, Javascript, Lua, Octave, PHP, Python, R, and Ruby.
MIT License
1.21k stars 209 forks source link

Cubic natural interpolation fails when interpolating three points in > 2D #226

Closed msteinbeck closed 1 year ago

msteinbeck commented 1 year ago

The issue results from the following call:

memcpy(thomas, points, sof_ctrlp);

Here points overwrites itself because thomas contains only two values (a and b) before it overlaps with points.