summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2022-10-03 06:55:20 +0200
committerخالد حسني <khaled@aliftype.com>2022-10-03 08:57:20 +0200
commit1dabf1fc58cf9e98bdc24efcca349fcc7a59d2d1 (patch)
treed5fb98ffa67c0a51974bc44131b96b9bdfe0a5f1 /vcl
parentbb67f10786fd5e232b198d09139c41078c3fc60d (diff)
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: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/fontsubset/sft.cxx8
1 files changed, 2 insertions, 6 deletions
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) {