Kaydet (Commit) 08dd51bf authored tarafından Caolán McNamara's avatar Caolán McNamara

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>
üst b746577d
...@@ -1656,7 +1656,8 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t ) ...@@ -1656,7 +1656,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