[Libreoffice-commits] core.git: chart2/source
Samuel Mehrbrodt (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 15 08:27:56 UTC 2021
chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit a6066989f7d346d0d43f8db46b12786546f769e8
Author: Samuel Mehrbrodt <samuel.mehrbrodt at allotropia.de>
AuthorDate: Thu Apr 15 08:42:09 2021 +0200
Commit: Samuel Mehrbrodt <samuel.mehrbrodt at allotropia.de>
CommitDate: Thu Apr 15 10:27:11 2021 +0200
tdf#141689 Fix crash in 'Central' moving avg function
Change-Id: I2dc5e517d5e3ff6283c9ff66c9f32ee95d66ef45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114121
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>
diff --git a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
index 5496f78577e6..1c456b8835e6 100644
--- a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
@@ -145,9 +145,10 @@ uno::Sequence< geometry::RealPoint2D > SAL_CALL MovingAverageRegressionCurveCalc
const uno::Reference< chart2::XScaling >& /*xScalingY*/,
sal_Bool /*bMaySkipPointsInCalculation*/ )
{
- uno::Sequence< geometry::RealPoint2D > aResult( aYList.size() );
+ size_t nSize = std::min(aXList.size(), aYList.size());
+ uno::Sequence< geometry::RealPoint2D > aResult( nSize );
- for( size_t i = 0; i < aYList.size(); ++i )
+ for( size_t i = 0; i < nSize; ++i )
{
aResult[i].X = aXList[i];
aResult[i].Y = aYList[i];
More information about the Libreoffice-commits
mailing list