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>
This commit is contained in:
Noel Grandin
2020-04-13 22:47:32 +02:00
committed by Noel Grandin
parent f2b3a5d287
commit 981de2fd95
+1 -1
View File
@@ -830,7 +830,7 @@ bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const
{
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()) )