vcl/source/gdi/metaact.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
New commits: commit 45f9c1862bd205f620ce21663a8cd91119b9b2d5 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Mar 16 16:25:03 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Mar 16 22:15:32 2022 +0100 ofz#45612 Timeout Change-Id: I9c6f955b243f9f5027c4b702853e6dce546054a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131667 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 abc4495e2b08..00c979f8f378 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -953,7 +953,7 @@ void MetaBmpExScaleAction::Execute( OutputDevice* pOut ) { if (utl::ConfigManager::IsFuzzing()) { - constexpr int nMaxScaleWhenFuzzing = 4096; + constexpr int nMaxScaleWhenFuzzing = 1024; auto nSourceHeight = maBmpEx.GetSizePixel().Height(); auto nDestHeight = maSz.Height(); @@ -963,6 +963,12 @@ void MetaBmpExScaleAction::Execute( OutputDevice* pOut ) return; } + if (nDestHeight && nSourceHeight > nDestHeight && nSourceHeight / nDestHeight > nMaxScaleWhenFuzzing) + { + SAL_WARN("vcl", "skipping large vertical scaling: " << nSourceHeight << " to " << nDestHeight); + return; + } + auto nSourceWidth = maBmpEx.GetSizePixel().Width(); auto nDestWidth = maSz.Width(); if (nSourceWidth && nDestWidth > nSourceWidth && nDestWidth / nSourceWidth > nMaxScaleWhenFuzzing) @@ -970,6 +976,12 @@ void MetaBmpExScaleAction::Execute( OutputDevice* pOut ) SAL_WARN("vcl", "skipping large horizontal scaling: " << nSourceWidth << " to " << nDestWidth); return; } + + if (nDestWidth && nSourceWidth > nDestWidth && nSourceWidth / nDestWidth > nMaxScaleWhenFuzzing) + { + SAL_WARN("vcl", "skipping large horizontal scaling: " << nSourceWidth << " to " << nDestWidth); + return; + } } pOut->DrawBitmapEx( maPt, maSz, maBmpEx );