diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-07 12:29:32 +0000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2018-02-07 16:04:39 +0100 |
commit | a39e2684d48046d18bd486d145b9d4a3d2044e8a (patch) | |
tree | 5be3f962dce45d3aaac9507356628d86b4279ec5 /vcl | |
parent | a224d33cbf098c361a7244569d5088044561f3ee (diff) |
sanity check cmap table size
Change-Id: I010c2fd221bcd86a62efd9996a0c34930828cb6d
Reviewed-on: https://gerrit.libreoffice.org/49350
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 0f031d055ae3..2170acd08d1c 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1231,6 +1231,12 @@ static void FindCmap(TrueTypeFont *ttf) { const sal_uInt8* table = getTable(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_uInt32 AppleUni = 0; // Apple Unicode sal_uInt32 ThreeZero = 0; /* MS Symbol */ |