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

cmap format 4 subtable checking #149

Open
mikeday opened this issue Sep 16, 2017 · 3 comments
Open

cmap format 4 subtable checking #149

mikeday opened this issue Sep 16, 2017 · 3 comments

Comments

@mikeday
Copy link

mikeday commented Sep 16, 2017

ots/src/cmap.cc

Line 242 in f87b455

if (glyph >= num_glyphs) {

I think it needs to add id_delta here to get the correct glyph index before checking the glyph is within range and non-negative.

@khaledhosny
Copy link
Owner

Sounds about right. Do you have fonts that fails without changing this? I’m rather surprised this didn’t surface before, if it is really an issue.

@mikeday
Copy link
Author

mikeday commented Sep 24, 2017

I couldn't find a font that triggers an actual error, because the font that we hit just returns the wrong glyph if you don't add id_delta, but it's still a valid glyph, not out of range. But it's possible that there is a font out there with a broken id_delta value that this won't catch.

@khaledhosny
Copy link
Owner

OK, I’ll see if I can make some test font to add to the test suite.

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