summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-22 20:37:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-08-23 15:46:51 +0200
commit0f02412d6baf9edb54c62856c52cebfa707291b2 (patch)
tree55208d39b6aed32b97644ca5ff0353069f10b7a1 /vcl
parentb683bbb14e74489988e12667d3193c8a32794b88 (diff)
crashtesting avoid problematic scaling triggered by moz1545040-1.svg
Change-Id: I906891f8d01870bd13a98fc6720abb7ffaa9be1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101189 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/gdimtf.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 246b3c91f4de..22b516924b2b 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2782,6 +2782,10 @@ bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, BmpConversion eColorConve
{
// initialization seems to be complicated but is used to avoid rounding errors
ScopedVclPtrInstance< VirtualDevice > aVDev;
+ // set EnableB2dDraw to tease the rendering down the code paths which use B2DPolygon and
+ // avoid integer overflows on scaling tools::Polygon, e.g. moz1545040-1.svg
+ // note: this is similar to DocumentToGraphicRenderer::renderToGraphic
+ aVDev->SetAntialiasing(AntialiasingFlags::EnableB2dDraw | aVDev->GetAntialiasing());
const Point aNullPt;
const Point aTLPix( aVDev->LogicToPixel( aNullPt, GetPrefMapMode() ) );
const Point aBRPix( aVDev->LogicToPixel( Point( GetPrefSize().Width() - 1, GetPrefSize().Height() - 1 ), GetPrefMapMode() ) );