Kaydet (Commit) a39e2684 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Michael Stahl

sanity check cmap table size

Change-Id: I010c2fd221bcd86a62efd9996a0c34930828cb6d
Reviewed-on: https://gerrit.libreoffice.org/49350Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst a224d33c
...@@ -1231,6 +1231,12 @@ static void FindCmap(TrueTypeFont *ttf) ...@@ -1231,6 +1231,12 @@ static void FindCmap(TrueTypeFont *ttf)
{ {
const sal_uInt8* table = getTable(ttf, O_cmap); const sal_uInt8* table = getTable(ttf, O_cmap);
sal_uInt32 table_size = getTableSize(ttf, O_cmap); sal_uInt32 table_size = getTableSize(ttf, O_cmap);
if (table_size < 4)
{
SAL_WARN("vcl.fonts", "Parsing error in " << OUString::createFromAscii(ttf->fname) <<
"cmap table size too short");
return;
}
sal_uInt16 ncmaps = GetUInt16(table, 2); sal_uInt16 ncmaps = GetUInt16(table, 2);
sal_uInt32 AppleUni = 0; // Apple Unicode sal_uInt32 AppleUni = 0; // Apple Unicode
sal_uInt32 ThreeZero = 0; /* MS Symbol */ sal_uInt32 ThreeZero = 0; /* MS Symbol */
......
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