[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 23 20:25:13 UTC 2020


 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 0346036520469d740222cecbfc6ead723be4e80e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 23 15:17:06 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Oct 23 22:24:33 2020 +0200

    log why a FreetypeFont was flagged as !mbFaceOk
    
    Change-Id: I6f474c1761e7b0d77a0c5516dd77a60e98c75996
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104732
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index cbca9eea1bac..d2addb9327a4 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -430,9 +430,17 @@ FreetypeFont::FreetypeFont(FreetypeFontInstance& rFontInstance, const std::share
     if( !mnWidth )
         mnWidth = rFSD.mnHeight;
     mfStretch = static_cast<double>(mnWidth) / rFSD.mnHeight;
-    // sanity check (e.g. #i66394#, #i66244#, #i66537#)
-    if( (mnWidth < 0) || (mfStretch > +64.0) || (mfStretch < -64.0) )
+    // sanity checks (e.g. #i66394#, #i66244#, #i66537#)
+    if (mnWidth < 0)
+    {
+        SAL_WARN("vcl", "FreetypeFont negative font width of: " << mnWidth);
         return;
+    }
+    if (mfStretch > +64.0 || mfStretch < -64.0)
+    {
+        SAL_WARN("vcl", "FreetypeFont excessive stretch of: " << mfStretch);
+        return;
+    }
 
     if( !maFaceFT )
         return;


More information about the Libreoffice-commits mailing list