summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-06 17:58:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-03-06 20:33:27 +0100
commit4e93ba94f1969b672632319fc45db02f6558f87e (patch)
treebf53ec01a6b8509dcacb52ce7036bcf9632b04c5
parente0cc2e1b775993ae559494bf373451f1cc326dfc (diff)
ofz#45255 handle short O_hhea table
Change-Id: I649dfdb3eff868441125fbf62ff3c7d0d18d8d19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131084 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/fontsubset/sft.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 875eeb96730e..1991683434ad 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1751,7 +1751,7 @@ SFErrCodes CreateTTFromTTGlyphs(AbstractTrueTypeFont *ttf,
/** hhea **/
p = ttf->table(O_hhea, nTableSize);
- if (p)
+ if (p && nTableSize >= HHEA_caretSlopeRun_offset + 2)
hhea = TrueTypeTableNew_hhea(GetInt16(p, HHEA_ascender_offset), GetInt16(p, HHEA_descender_offset), GetInt16(p, HHEA_lineGap_offset), GetInt16(p, HHEA_caretSlopeRise_offset), GetInt16(p, HHEA_caretSlopeRun_offset));
else
hhea = TrueTypeTableNew_hhea(0, 0, 0, 0, 0);