diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-03-08 13:59:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-03-09 08:28:54 +0000 |
commit | 45d335e388566565ed53f7f7628f7351f88fd242 (patch) | |
tree | 2e86b2d8ef957f65b83259cfd77af019a3e7f91a /drawinglayer/source/processor2d | |
parent | d95a09c1fca70d658207b8c48761af32dd2df213 (diff) |
crashtesting: assert seen on load of moz1297206-1.svg
Change-Id: Ide16b0086ef81bb9580b93f63c2c5220459d74d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148478
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'drawinglayer/source/processor2d')
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index f13b7c4aadb2..ecfbf31f7ec4 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -377,9 +377,23 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D( const Point aOrigin( basegfx::fround(aCurrentTranslate.getX() / aCurrentScaling.getX()), basegfx::fround(aCurrentTranslate.getY() / aCurrentScaling.getY())); - MapMode aMapMode(mpOutputDevice->GetMapMode().GetMapUnit(), aOrigin, - Fraction(aCurrentScaling.getX()), - Fraction(aCurrentScaling.getY())); + + Fraction aScaleX(aCurrentScaling.getX()); + if (!aScaleX.IsValid()) + { + SAL_WARN("drawinglayer", "invalid X Scale"); + return; + } + + Fraction aScaleY(aCurrentScaling.getY()); + if (!aScaleY.IsValid()) + { + SAL_WARN("drawinglayer", "invalid Y Scale"); + return; + } + + MapMode aMapMode(mpOutputDevice->GetMapMode().GetMapUnit(), aOrigin, aScaleX, + aScaleY); if (fCurrentRotate) aTextTranslate *= basegfx::utils::createRotateB2DHomMatrix(fCurrentRotate); |