diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-07 15:33:36 +0000 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-06-01 14:46:38 +0200 |
commit | 038175f960401e0be0a26e74c9c0c5ff052c31fd (patch) | |
tree | 7cdafbda4127d8435507280e50c6ff37f429fab5 | |
parent | d5a86c604c7c3ff459be28521f7689742e0545db (diff) |
check table size before reading nglyphs
Change-Id: Ib511fdf16006877ca76085137eb9200601b2f8f7
Reviewed-on: https://gerrit.libreoffice.org/49363
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 08dd51bfcaa6b493e134bcc7787cc18c36ad5db1)
Reviewed-on: https://gerrit.libreoffice.org/49436
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 0e0978b779c0..d97be8071272 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1693,7 +1693,8 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t ) } const sal_uInt8* table = getTable(t, O_maxp); - t->nglyphs = GetUInt16(table, 4, 1); + sal_uInt32 table_size = getTableSize(t, O_maxp); + t->nglyphs = table_size >= 6 ? GetUInt16(table, 4, 1) : 0; table = getTable(t, O_head); t->unitsPerEm = GetUInt16(table, 18, 1); |