diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-05-07 12:23:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-05-07 14:17:12 +0200 |
commit | 2aabb00d573be097f9d2e9ae4950991035cdcfc4 (patch) | |
tree | 8790123cf7514f1dc481a25f287f0b87649474ef /vcl | |
parent | 6f67eb36d035fa3fe4103e497207452602ff993b (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/metaact.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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; |