summaryrefslogtreecommitdiffstats
path: root/gfx/ots/src/ots.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /gfx/ots/src/ots.cc
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/ots/src/ots.cc')
-rw-r--r--gfx/ots/src/ots.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/gfx/ots/src/ots.cc b/gfx/ots/src/ots.cc
index 73b1d235cf..1ee4498363 100644
--- a/gfx/ots/src/ots.cc
+++ b/gfx/ots/src/ots.cc
@@ -728,12 +728,18 @@ bool ProcessGeneric(ots::FontFile *header,
ots::Table *loca = font->GetTable(OTS_TAG_LOCA);
ots::Table *cff = font->GetTable(OTS_TAG_CFF);
ots::Table *cff2 = font->GetTable(OTS_TAG_CFF2);
+ ots::OpenTypeMAXP *maxp = static_cast<ots::OpenTypeMAXP*>(
+ font->GetTypedTable(OTS_TAG_MAXP));
if (glyf && loca) {
if (font->version != 0x000010000) {
OTS_WARNING_MSG_HDR("wrong sfntVersion for glyph data");
font->version = 0x000010000;
}
+ if (!maxp->version_1) {
+ return OTS_FAILURE_MSG_TAG("wrong maxp version for glyph data",
+ OTS_TAG_MAXP);
+ }
if (cff)
cff->Drop("font contains both CFF and glyf/loca tables");
if (cff2)
@@ -747,6 +753,10 @@ bool ProcessGeneric(ots::FontFile *header,
glyf->Drop("font contains both CFF and glyf tables");
if (loca)
loca->Drop("font contains both CFF and loca tables");
+ if (maxp->version_1) {
+ OTS_WARNING_MSG_HDR("fixing incorrect maxp version for CFF font");
+ maxp->version_1 = false;
+ }
} else if (font->GetTable(OTS_TAG('C','B','D','T')) &&
font->GetTable(OTS_TAG('C','B','L','C'))) {
// We don't sanitize bitmap tables, but don’t reject bitmap-only fonts if