crash when first two curve points are at x=0, fixes #2888

This commit is contained in:
heckflosse
2015-09-01 18:09:46 +02:00
parent 11d382d998
commit 98c1221908

View File

@@ -70,6 +70,10 @@ DiagonalCurve::DiagonalCurve (const std::vector<double>& p, int poly_pn)
identity = false; identity = false;
} }
if(x[0] == 0.f && x[1] == 0.f)
// Avoid crash when first two points are at x = 0 (git Issue 2888)
x[1] = 0.5f;
if (!identity) { if (!identity) {
if (kind == DCT_Spline && N > 2) { if (kind == DCT_Spline && N > 2) {
spline_cubic_set (); spline_cubic_set ();