From 841788923ce185c140ebeac6d34faffa348c8b6e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 13 Mar 2022 11:23:07 +0000 Subject: ofz#45527 detect too many points earlier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7716ca8b9de9312bcaabf1d16e60dbac7ae87e52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131492 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- tools/source/generic/poly.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index b3f53cb0e673..687cb6a5d4fb 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -1156,7 +1156,8 @@ static void ImplAdaptiveSubdivide( std::vector& rPoints, // stop if distance from line is guaranteed to be bounded by d if( old_d2 > d2 && recursionDepth < maxRecursionDepth && - distance2 >= d2 ) + distance2 >= d2 && + rPoints.size() < SAL_MAX_UINT16 ) { // deCasteljau bezier arc, split at t=0.5 // Foley/vanDam, p. 508 -- cgit