Skip to content

Sanitize glyf composite cycles, OS/2 length and maxp version mismatches - #21300

Merged
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:issue21298
May 21, 2026
Merged

calixteman merged 1 commit into
mozilla:masterfrom
calixteman:issue21298

Conversation

@calixteman

@calixteman calixteman commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Prune the back-edge components from cyclic composite glyphs in sanitizeGlyphLocations (leaving non-cyclic siblings intact), reject OS/2 tables whose length is too short for the declared version so a clean table gets regenerated, and upgrade a version 0.5 maxp table to 1.0 for TrueType fonts to silence OTS' "wrong maxp version for glyph data".

It fixes #21298.

@calixteman
calixteman requested a review from timvandermeij May 19, 2026 19:59
@calixteman

Copy link
Copy Markdown
Contributor Author

/botio-linux browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 1

Live output at: http://54.241.84.105:8877/e65634773e05224/output.txt

@calixteman
calixteman marked this pull request as ready for review May 19, 2026 20:00
@codecov-commenter

codecov-commenter commented May 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.87379% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.40%. Comparing base (f500cff) to head (d6a2b91).
⚠️ Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
src/core/glyf.js 80.72% 16 Missing ⚠️
src/core/fonts.js 27.77% 13 Missing ⚠️
src/core/font_renderer.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21300      +/-   ##
==========================================
+ Coverage   81.28%   81.40%   +0.11%     
==========================================
  Files         256      256              
  Lines       64873    65328     +455     
==========================================
+ Hits        52730    53178     +448     
- Misses      12143    12150       +7     
Flag Coverage Δ
fonttest 9.11% <66.99%> (+0.42%) ⬆️
integrationtest 66.98% <57.28%> (+0.20%) ⬆️
unittest 56.84% <56.31%> (-0.26%) ⬇️
unittestcli 56.05% <56.31%> (-0.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/e65634773e05224/output.txt

Total script time: 8.69 mins

  • Regression tests: FAILED
  errors: 5

Image differences available at: http://54.241.84.105:8877/e65634773e05224/reftest-analyzer.html#web=eq.log

@calixteman

Copy link
Copy Markdown
Contributor Author

/botio-linux browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/6a7ddb72a828900/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/6a7ddb72a828900/output.txt

Total script time: 6.78 mins

  • Regression tests: FAILED
  errors: 5

Image differences available at: http://54.241.84.105:8877/6a7ddb72a828900/reftest-analyzer.html#web=eq.log

@calixteman

Copy link
Copy Markdown
Contributor Author

/botio-linux browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/684461b27fc9610/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/684461b27fc9610/output.txt

Total script time: 18.45 mins

  • Regression tests: FAILED
  different ref/snapshot: 2

Image differences available at: http://54.241.84.105:8877/684461b27fc9610/reftest-analyzer.html#web=eq.log

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/09b36f0b4e2924e/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/09b36f0b4e2924e/output.txt

Total script time: 18.29 mins

  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.241.84.105:8877/09b36f0b4e2924e/reftest-analyzer.html#web=eq.log

@calixteman

Copy link
Copy Markdown
Contributor Author

The "regression" is an improvement.

@timvandermeij timvandermeij left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, with the comment addressed; thank you!

Comment thread src/core/glyf.js Resolved
Prune the back-edge components from cyclic composite glyphs in
sanitizeGlyphLocations (leaving non-cyclic siblings intact), reject OS/2
tables whose length is too short for the declared version so a clean
table gets regenerated, and upgrade a version 0.5 maxp table to 1.0 for
TrueType fonts to silence OTS' "wrong maxp version for glyph data".

It fixes mozilla#21298.
@calixteman

Copy link
Copy Markdown
Contributor Author

/botio-linux browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/5a20822a3060704/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/5a20822a3060704/output.txt

Total script time: 18.21 mins

  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.241.84.105:8877/5a20822a3060704/reftest-analyzer.html#web=eq.log

@calixteman
calixteman merged commit 98e3a85 into mozilla:master May 21, 2026
22 checks passed
@calixteman

Copy link
Copy Markdown
Contributor Author

/botio-linux makeref

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/dffb40dc787453b/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/dffb40dc787453b/output.txt

Total script time: 18.25 mins

  • Make references: Passed
  • Check references: Passed

@calixteman
calixteman deleted the issue21298 branch May 21, 2026 20:12

This branch was previously deployed

1 inactive deployment
code-coverage — d6a2b912 Deployed May 21, 2026 by calixteman via Test (24) #15707
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: glyf: Component depth exceeds maxp maxComponentDepth

4 participants