drawinglayer/source/processor2d/vclprocessor2d.cxx |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 45d335e388566565ed53f7f7628f7351f88fd242
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Mar 8 13:59:50 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Mar 9 08:28:54 2023 +0000

    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 <caol...@redhat.com>

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);

Reply via email to