vcl/source/fontsubset/sft.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit a94ff76521463e7d37840c422c6350edef40bf6b Author: Caolán McNamara <caol...@redhat.com> Date: Wed Feb 7 12:29:32 2018 +0000 sanity check cmap table size Change-Id: I010c2fd221bcd86a62efd9996a0c34930828cb6d Reviewed-on: https://gerrit.libreoffice.org/49349 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 098d54b41b2d..1a4f5f16e4ef 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1225,6 +1225,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 */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits