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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 22 16:06:48 UTC 2021


 vcl/source/fontsubset/sft.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6a45671d64f6c8c6e9cbc0e5e2388e5bc9b281e9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Mar 22 11:43:48 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Mar 22 17:05:56 2021 +0100

    cid#1473807 Untrusted divisor
    
    Change-Id: I074c177a51f99ee7b5020f84c32445b781a9857f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112886
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 65cc77f3ba4b..d2936b9e0583 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1967,7 +1967,7 @@ std::unique_ptr<sal_uInt16[]> GetTTSimpleGlyphMetrics(AbstractTrueTypeFont const
             nAdvOffset = 4 * (n - 1);
         }
 
-        if( nAdvOffset >= nTableSize)
+        if (nAdvOffset >= nTableSize || UPEm == 0)
             res[i] = 0; /* better than a crash for buggy fonts */
         else
             res[i] = static_cast<sal_uInt16>(


More information about the Libreoffice-commits mailing list