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

New commits:
commit 1dabf1fc58cf9e98bdc24efcca349fcc7a59d2d1
Author:     Khaled Hosny <kha...@aliftype.com>
AuthorDate: Mon Oct 3 06:55:20 2022 +0200
Commit:     خالد حسني <kha...@aliftype.com>
CommitDate: Mon Oct 3 08:57:20 2022 +0200

    vcl: Drop redundant check
    
    The code already does the same check above.
    
    Change-Id: Ia9a9bd743235f888af1bb8ff2bd7f16e9776619e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140898
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@aliftype.com>

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index b51f2d3422ee..3bf3beac9080 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1458,11 +1458,6 @@ int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID, std::vec
     if (nOffset > nNextOffset)
         return 0;
 
-    const sal_uInt8* ptr = glyf + nOffset;
-    const sal_uInt8* nptr = glyf + nNextOffset;
-    if (nptr < ptr)
-        return 0;
-
     if (std::find(glyphlist.begin(), glyphlist.end(), glyphID) != 
glyphlist.end())
     {
         SAL_WARN("vcl.fonts", "Endless loop found in a compound glyph.");
@@ -1472,9 +1467,10 @@ int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID, std::vec
     glyphlist.push_back( glyphID );
 
     // Empty glyph.
-    if (nptr == ptr)
+    if (nOffset == nNextOffset)
         return n;
 
+    const auto* ptr = glyf + nOffset;
     sal_uInt32 nRemainingData = glyflength - nOffset;
 
     if (nRemainingData >= 10 && GetInt16(ptr, 0) == -1) {

Reply via email to