diff options
-rw-r--r-- | chart2/source/view/charttypes/Splines.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx index 7129d4450837..8cb7fcb2d7aa 100644 --- a/chart2/source/view/charttypes/Splines.cxx +++ b/chart2/source/view/charttypes/Splines.cxx @@ -24,6 +24,8 @@ #include <algorithm> #include <functional> +#define MAX_BSPLINE_DEGREE 15 + //............................................................................. namespace chart { @@ -691,7 +693,9 @@ void SplineCalculater::CalculateBSplines( // ODF1.2 spec variable p OSL_ASSERT( nResolution > 1 ); OSL_ASSERT( nDegree >= 1 ); - sal_uInt32 p = nDegree; + + // limit the b-spline degree to prevent insanely large sets of points + sal_uInt32 p = std::min<sal_uInt32>(nDegree, MAX_BSPLINE_DEGREE); rResult.SequenceX.realloc(0); rResult.SequenceY.realloc(0); |