diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-07 15:33:36 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-06 15:20:46 +0100 |
commit | 7707ce3b6fc050e9182bf0487d13199792476d49 (patch) | |
tree | 53f02d9a39c7183c889c703f4638ae0431c298eb /vcl | |
parent | 2f522d9c0d15877b98bf14db74a53b2bf41fb6cf (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>
(cherry picked from commit 419361ac5c0eacfb1c766a4fa042a6000d96ba7d)
Diffstat (limited to 'vcl')
-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 dd134305bc95..11620beda5ae 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1680,7 +1680,8 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t ) } const sal_uInt8* table = getTable(t, O_maxp); - t->nglyphs = GetUInt16(table, 4); + sal_uInt32 table_size = getTableSize(t, O_maxp); + t->nglyphs = table_size >= 6 ? GetUInt16(table, 4) : 0; table = getTable(t, O_head); t->unitsPerEm = GetUInt16(table, 18); |