vcl/unx/generic/gdi/cairotextrender.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 0cc9d19db04fae6e5e1bd4d1020863ec76894300
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Oct 20 10:38:55 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Oct 20 12:53:34 2022 +0200

    ofz#52537 Abrt
    
    Change-Id: I3362e0a78d29084d49389ed8f0f3173869850451
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141552
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx 
b/vcl/unx/generic/gdi/cairotextrender.cxx
index 89f74f8298c7..6f462b4e3377 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -215,6 +215,12 @@ void CairoTextRender::DrawTextLayout(const 
GenericSalLayout& rLayout, const SalG
     }
 
     int nRatio = nWidth * 10 / nHeight;
+    if (nRatio >= 5120)
+    {
+        // as seen with freetype 2.12.1, so cairo surface status is "fail"
+        SAL_WARN("vcl", "rendering text would fail with stretch of: " << 
nRatio / 10.0);
+        return;
+    }
 
     /*
      * It might be ideal to cache surface and cairo context between calls and

Reply via email to