tdf#104878 related, fix abort()
in SkiaCompatibleDC::getImageAsDiff
when loading the larger example file.
We hit the abort because we have a rectangle here
with width and height -2.
Not sure where that is coming from, because the crash
doesn't happen in debug build, only optimised.
Change-Id: I448b418dee26536d361e82e4d649be447ba43725
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92127
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index fa5656b..16a3080 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -830,7 +830,7 @@
{
bool bRet = false;
tools::Rectangle aControlRegion(rControlRegion);
if (aControlRegion.IsEmpty())
if (aControlRegion.IsEmpty() || aControlRegion.GetWidth() <= 0 || aControlRegion.GetHeight() <= 0)
return bRet;
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )