Kaydet (Commit) 7707ce3b authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

check table size before reading nglyphs

Change-Id: Ib511fdf16006877ca76085137eb9200601b2f8f7
Reviewed-on: https://gerrit.libreoffice.org/49363Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
(cherry picked from commit 08dd51bf)
Reviewed-on: https://gerrit.libreoffice.org/49436Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
(cherry picked from commit 419361ac)
üst 2f522d9c
...@@ -1680,7 +1680,8 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t ) ...@@ -1680,7 +1680,8 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
} }
const sal_uInt8* table = getTable(t, O_maxp); 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); table = getTable(t, O_head);
t->unitsPerEm = GetUInt16(table, 18); t->unitsPerEm = GetUInt16(table, 18);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment