diff options
Diffstat (limited to 'Build/source/libs/graphite2/graphite2-src/src/TtfUtil.cpp')
-rw-r--r-- | Build/source/libs/graphite2/graphite2-src/src/TtfUtil.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Build/source/libs/graphite2/graphite2-src/src/TtfUtil.cpp b/Build/source/libs/graphite2/graphite2-src/src/TtfUtil.cpp index 75e8da11c45..4fb73f2409f 100644 --- a/Build/source/libs/graphite2/graphite2-src/src/TtfUtil.cpp +++ b/Build/source/libs/graphite2/graphite2-src/src/TtfUtil.cpp @@ -341,6 +341,11 @@ bool CheckTable(const Tag TableId, const void * pTable, size_t lTableSize) return be::swap(pName->format) == 0; } + case Tag::glyf: + { + return (lTableSize >= sizeof(Sfnt::Glyph)); + } + default: break; } @@ -464,7 +469,7 @@ void HeadTableModifyTime(const void * pHead, { const Sfnt::FontHeader * pTable = reinterpret_cast<const Sfnt::FontHeader *>(pHead); - + ; *pnDateBC = be::swap(pTable->modified[0]); *pnDateAD = be::swap(pTable->modified[1]); } @@ -1247,7 +1252,7 @@ size_t LocaLookup(gid16 nGlyphId, void * GlyfLookup(const void * pGlyf, size_t nGlyfOffset, size_t nTableLen) { const uint8 * pByte = reinterpret_cast<const uint8 *>(pGlyf); - if (nGlyfOffset + pByte < pByte || nGlyfOffset + sizeof(Sfnt::Glyph) >= nTableLen) + if (nGlyfOffset + pByte < pByte || nGlyfOffset >= nTableLen - sizeof(Sfnt::Glyph)) return NULL; return const_cast<uint8 *>(pByte + nGlyfOffset); } |