imageworks/OpenShadingLanguage — pull request #317 by lgritz (2013-12-19 18:10:59+00:00)
Title: Fix subtle bug with splines and arrays.

It took a special set of circumstances: the variety of spline that takes
an array of knot values, but where the user passes how many knots to use
and it's less than the full length of the array, AND the knot array has
derivatives. When accessing the derivatives, it was offsetting to find
them based on the number of knots being used, but it should have been
the array length generating the offset (the positions of the derivs
don't change just because you aren't using all the array elements to
store the knot values). So it was reading bogus, potentially
uninitialized values.

The solution involved needing to pass both the num_knots and the
knot_arraylen to the various spline routines.

Along the way, for debugging help, I also modified nan/inf checking to
print the op name as well as the source file and line.

I added a regression test as part of testsuite/spline.