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

coretext shaper causes segfault on "sparse" font #83

Closed
justvanrossum opened this issue May 16, 2021 · 2 comments · Fixed by #84
Closed

coretext shaper causes segfault on "sparse" font #83

justvanrossum opened this issue May 16, 2021 · 2 comments · Fixed by #84

Comments

@justvanrossum
Copy link
Collaborator

I have a font that only has GPOS, cmap, head, maxp and post tables, which works perfectly fine for the default (ot) shaper, but crashes hard when specifying the coretext shaper on macOS.

Relates to justvanrossum/fontgoggles#144

(FontGoggles compiles this kind of minimal fonts on the fly to do shaping for UFO sources: metrics come from the source via hb callbacks, and outlines are directly drawn from the sources, too.)

I'll open a PR that reproduces the problem.

@behdad
Copy link
Member

behdad commented May 16, 2021

(FontGoggles compiles this kind of minimal fonts on the fly to do shaping for UFO sources: metrics come from the source via hb callbacks, and outlines are directly drawn from the sources, too.)

Beautiful. I had designed HB to be used that way :).

Does the crash reproduce with hb-view?

@justvanrossum
Copy link
Collaborator Author

Beautiful. I had designed HB to be used that way :).

It's pretty fantastic indeed :)

Does the crash reproduce with hb-view?

It fails gracefully like this:

$ hb-view testfont.ttf ABC --shapers=coretext
hb-view: all shapers failed.
hb-view: FT_New_Memory_Face fail

So no, it doesn't crash.

@khaledhosny khaledhosny linked a pull request Jul 24, 2021 that will close this issue
khaledhosny pushed a commit that referenced this issue Jul 24, 2021
khaledhosny added a commit that referenced this issue Jul 24, 2021
hb_shape_full() takes a NULL-terminated array (the length of the array
is not passed separately) and would otherwise try to access random
memory and crash if all shapers failed.

Fixes #83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants