summaryrefslogtreecommitdiff
path: root/vcl/source/fontsubset/ttcr.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-02-26 21:40:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-03-04 12:47:49 +0100
commit8906788e25296f3875682bad374e6845f4bb20e2 (patch)
tree0ffe0e6dc36a020e8790f3632b138266ab9d8681 /vcl/source/fontsubset/ttcr.cxx
parente16281915ef61b657d60d9200abbe365dfc8acad (diff)
ofz#45073 don't dereference null pointer on bogus font
Change-Id: I28616696833b87c300d2ee7061a15921042934b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130613 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130936 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'vcl/source/fontsubset/ttcr.cxx')
-rw-r--r--vcl/source/fontsubset/ttcr.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index 86dc02206e92..40729ffd101d 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -1250,7 +1250,11 @@ static void ProcessTables(TrueTypeCreator *tt)
glyf = FindTable(tt, T_glyf);
glyphlist = static_cast<list>(glyf->data);
nGlyphs = listCount(glyphlist);
- assert(nGlyphs != 0);
+ if (!nGlyphs)
+ {
+ SAL_WARN("vcl.fonts", "no glyphs found in ProcessTables");
+ return;
+ }
gid = static_cast<sal_uInt32*>(scalloc(nGlyphs, sizeof(sal_uInt32)));
RemoveTable(tt, T_loca);