[poppler] fofi/FoFiTrueType.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Mar 4 13:42:59 UTC 2022


 fofi/FoFiTrueType.cc |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 35f06568f51c8dd9fb936b74db766169b91de630
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Mar 3 16:39:06 2022 +0100

    FoFiTrueType: Parse CFF2 fonts too

diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index dca1be0b..72badfa3 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -639,7 +639,7 @@ bool FoFiTrueType::getCFFBlock(char **start, int *length) const
         return false;
     }
     i = seekTable("CFF ");
-    if (!checkRegion(tables[i].offset, tables[i].len)) {
+    if (i < 0 || !checkRegion(tables[i].offset, tables[i].len)) {
         return false;
     }
     *start = (char *)file + tables[i].offset;
@@ -1550,7 +1550,7 @@ void FoFiTrueType::parse()
 
     // check for tables that are required by both the TrueType spec and
     // the Type 42 spec
-    if (seekTable("head") < 0 || seekTable("hhea") < 0 || seekTable("maxp") < 0 || (!openTypeCFF && seekTable("loca") < 0) || (!openTypeCFF && seekTable("glyf") < 0) || (openTypeCFF && seekTable("CFF ") < 0)) {
+    if (seekTable("head") < 0 || seekTable("hhea") < 0 || seekTable("maxp") < 0 || (!openTypeCFF && seekTable("loca") < 0) || (!openTypeCFF && seekTable("glyf") < 0) || (openTypeCFF && (seekTable("CFF ") < 0 && seekTable("CFF2") < 0))) {
         parsedOk = false;
         return;
     }


More information about the poppler mailing list