summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2017-10-13 20:58:08 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2017-10-13 23:41:40 +0200
commitabc401787179b097dcbc1006fa454980537bfc0b (patch)
treed5cf78c656d3b80cb999f2ba3bc9c29e3dea699c
parent2c6e7f6cf121446ef41f34e972aae205f233a191 (diff)
tdf#107605: Fix reading version 0 OS/2 font table
The version 0 table os exactly 78 bytes since it does not have any of the extra fields from the later versions. Change-Id: Ie2e478bdefb201b988dc0844240d4ff193d66583 Reviewed-on: https://gerrit.libreoffice.org/43374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
-rw-r--r--vcl/source/fontsubset/sft.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index a322848056ee..ef7eef5a03ff 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2396,7 +2396,7 @@ void GetTTFontMetrics(const std::vector<uint8_t>& hhea,
* FIXME: horribly outdated comment and horrible code that uses hard-coded
* offsets to read the table.
*/
- if (os2.size() > 76 + 2)
+ if (os2.size() >= 76 + 2)
{
info->fsSelection = GetUInt16(os2.data(), 62);
info->typoAscender = GetInt16(os2.data(), 68);
@@ -2406,7 +2406,7 @@ void GetTTFontMetrics(const std::vector<uint8_t>& hhea,
info->winDescent = GetUInt16(os2.data(), 76);
}
- if (hhea.size() > 8 + 2) {
+ if (hhea.size() >= 8 + 2) {
info->ascender = GetInt16(hhea.data(), 4);
info->descender = GetInt16(hhea.data(), 6);
info->linegap = GetInt16(hhea.data(), 8);