-
Notifications
You must be signed in to change notification settings - Fork 65
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
Must not crash on null family_name #124
Comments
springmeyer
pushed a commit
that referenced
this issue
Nov 23, 2016
springmeyer
pushed a commit
that referenced
this issue
Nov 23, 2016
This was referenced Nov 23, 2016
Note: this results in a SIGABRT (exit code 134) on linux and a SEGSEGV (exit code 139) on OSX. Linux:
OS X:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
Saw a crash like:
After investigating, it is happening because:
std::string
loadAsync
so it goes unhandled and ends up aborting the entire processI confirmed that this error can come from passing a NULL string, and when unhandled will abort:
Fixing the problem
We need to:
The remaining question is where in the
loadAsync
could a NULL be sent tostd::string
. I dug into the freetype docs and found it is possible for fonts to have a NULL family name per theCan be NULL
in:refs https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_FaceRec
We are currently not catching this case, which leads to a crash like this:
While fonts without a family name are rare I was able to find one from the harfbuzz testsuite: https://github.com/behdad/harfbuzz/blob/7793aad946e09b53523b30d57de85abd1d15f8b6/test/shaping/fonts/sha1sum/1c2c3fc37b2d4c3cb2ef726c6cdaaabd4b7f3eb9.ttf
//cc @mikemorris @xrwang @ianshward
The text was updated successfully, but these errors were encountered: