spline interpolation: fix crash bugs on negative speed and NULL inputs