From 2aabb00d573be097f9d2e9ae4950991035cdcfc4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 7 May 2023 12:23:00 +0100 Subject: ofz#57493 Timeout negative width/height is negated and mirrored by vcl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I70c0a72d6bbbec7e809edc856976633fce3efa9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151458 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/gdi/metaact.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index eab791889ce6..107972fe8765 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -893,13 +893,13 @@ static bool AllowScale(const Size& rSource, const Size& rDest) auto nSourceHeight = rSource.Height(); auto nDestHeight = rDest.Height(); - if (nSourceHeight && nDestHeight > nSourceHeight && nDestHeight / nSourceHeight > nMaxScaleWhenFuzzing) + if (nSourceHeight && std::abs(nDestHeight / nSourceHeight) > nMaxScaleWhenFuzzing) { SAL_WARN("vcl", "skipping large vertical scaling: " << nSourceHeight << " to " << nDestHeight); return false; } - if (nDestHeight && nSourceHeight > nDestHeight && nSourceHeight / nDestHeight > nMaxScaleWhenFuzzing) + if (nDestHeight && std::abs(nSourceHeight / nDestHeight) > nMaxScaleWhenFuzzing) { SAL_WARN("vcl", "skipping large vertical scaling: " << nSourceHeight << " to " << nDestHeight); return false; @@ -907,13 +907,13 @@ static bool AllowScale(const Size& rSource, const Size& rDest) auto nSourceWidth = rSource.Width(); auto nDestWidth = rDest.Width(); - if (nSourceWidth && nDestWidth > nSourceWidth && nDestWidth / nSourceWidth > nMaxScaleWhenFuzzing) + if (nSourceWidth && std::abs(nDestWidth / nSourceWidth) > nMaxScaleWhenFuzzing) { SAL_WARN("vcl", "skipping large horizontal scaling: " << nSourceWidth << " to " << nDestWidth); return false; } - if (nDestWidth && nSourceWidth > nDestWidth && nSourceWidth / nDestWidth > nMaxScaleWhenFuzzing) + if (nDestWidth && std::abs(nSourceWidth / nDestWidth) > nMaxScaleWhenFuzzing) { SAL_WARN("vcl", "skipping large horizontal scaling: " << nSourceWidth << " to " << nDestWidth); return false; -- cgit