Skip mark-positioning lookups with null anchors instead of crashing#374
Open
lehni wants to merge 1 commit into
Open
Skip mark-positioning lookups with null anchors instead of crashing#374lehni wants to merge 1 commit into
lehni wants to merge 1 commit into
Conversation
8e6fe5c to
00519d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GPOS subtables (Lookup Types 4, 5, 6) may legally contain NULL anchor offsets per the OT spec — they mean "no anchor for this base/ligature/mark class in this lookup", which the layout engine should treat as a no-op rather than an error.
GPOSProcessor.applyAnchorcurrently dereferences bothbaseAnchorandmarkRecord.markAnchorwithout guarding againstnull, so any font that ships a NULL anchor crashes withTypeError: Cannot read properties of null (reading 'xCoordinate')during shaping.Add an early-return null check in
applyAnchor, matching HarfBuzz's behaviour (MarkBasePosFormat1.hhand friends silently skip the application when the anchor is null).Test
Added the hinted Noto Sans Malayalam (
NotoSansMalayalam-Hinted.ttf, SIL OFL) which ships 189 NULL anchors. Layout ofപുസ്തകംreaches the null path and used to throw; the assertion now matches HarfBuzz's output exactly.Resolves #367.