vcl/source/gdi/metaact.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 2aabb00d573be097f9d2e9ae4950991035cdcfc4 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun May 7 12:23:00 2023 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun May 7 14:17:12 2023 +0200 ofz#57493 Timeout negative width/height is negated and mirrored by vcl Change-Id: I70c0a72d6bbbec7e809edc856976633fce3efa9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151458 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> 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;