[Libreoffice-commits] core.git: Branch 'feature/cib_contract935' - vcl/source
Khaled Hosny
khaledhosny at eglug.org
Mon May 28 09:22:41 UTC 2018
vcl/source/fontsubset/sft.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 4ea25643ffa8acfa53703394fb0376b09e225324
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Fri Oct 13 20:58:08 2017 +0200
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 at libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
(cherry picked from commit abc401787179b097dcbc1006fa454980537bfc0b)
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index d4a8b5a764a6..d1397efc4ecc 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2532,7 +2532,7 @@ void GetTTFontMterics(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);
@@ -2542,7 +2542,7 @@ void GetTTFontMterics(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);
More information about the Libreoffice-commits
mailing list