Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[makeotfexe] Fails to detect offset overflow error #731

Closed
readroberts opened this issue Feb 6, 2019 · 0 comments
Closed

[makeotfexe] Fails to detect offset overflow error #731

readroberts opened this issue Feb 6, 2019 · 0 comments
Assignees

Comments

@readroberts
Copy link
Contributor

The offset from a lookup record to a subtable is measured from start of the LookupList to the start of the subtable. However, when filling the subtables, you can't yet know how large the LookupList is. When makeotfexe calculates the offset to a lookup subtable, it actually calculates it only from the end of the lookup list, and the checks for an offset overflow are applied to this value. The final value written to the font, however, has the length of the lookup list added: thus an offset which is just a bit smaller the 64K can get pushed over the edge. These are most likely to happen in the aalt feature, as these lookups are almost always first in the LookupList, and (for arcane reasons) the subtables are sorted to the end of the subtable list, so the offsets from the aalt lookup tables to their subtables is the greatest for any of the subtables. You can reduce this effect by using useExtension with the aalt feature. This bug is also more likely to happen when many contextual rules are used, as makeotf makes a separate subtable for each rule, which makes the lookup table which contains the rules much larger, hence the size of the LookUpList is greater. Thanks to Paul de Laan and Edgar Walthert for finding this bug.

@miguelsousa miguelsousa changed the title [makeotf] Fails to detect offset overflow error [makeotfexe] Fails to detect offset overflow error Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants