vcl/source/fontsubset/sft.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b98c6e213fa8cbae54c63ce30e7c07cca73b8860
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Sep 26 12:28:26 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Sep 26 16:34:14 2022 +0200

    crashtesting: don't assert on bogus font name in embedded ttf
    
    seen with kde156448-1.pdf, fontforge also warns about the fontname.
    Looks like the name starts in little endian (wrong) before switching
    to big endian and/or is initially out by one.
    
    䄀爀椀愀氀-BoldItalic
    should have been
    Arial-BoldItalic
    
    Change-Id: I4cd9f8bc6bc70d6e9a91c24801629ba140a3b675
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140614
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 5c9cc85201e3..80a355423c6b 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -894,7 +894,7 @@ static OString nameExtract( const sal_uInt8* name, int 
nTableSize, int n, int db
         for (int i = 0; i < len/2; i++)
         {
             res[i] = *(ptr + i * 2 + 1);
-            assert(res[i] != 0);
+            SAL_WARN_IF(res[i] == 0, "vcl.fonts", "font name is bogus");
         }
         if( ucs2result )
         {
@@ -903,7 +903,7 @@ static OString nameExtract( const sal_uInt8* name, int 
nTableSize, int n, int db
             for (int i = 0; i < len/2; i++ )
             {
                 buf[i] = GetUInt16( ptr, 2*i );
-                assert(buf[i] != 0);
+                SAL_WARN_IF(buf[i] == 0, "vcl.fonts", "font name is bogus");
             }
             *ucs2result = buf.makeStringAndClear();
         }

Reply via email to