diff options
author | Raph Levien <raph@google.com> | 2012-07-31 19:26:25 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-07-31 19:26:25 -0700 |
commit | fbb38cd17727043aa04957aa5edd7c9fec4d076a (patch) | |
tree | 8b577408e344045624afea5a9311cef3646d41b6 | |
parent | 963a513ae15ebf9c7abcce70cc8d52703841b6e5 (diff) | |
parent | e454fde2aeb9f50cae4ae6d3237aac6553540ff5 (diff) | |
download | external_skia-fbb38cd17727043aa04957aa5edd7c9fec4d076a.zip external_skia-fbb38cd17727043aa04957aa5edd7c9fec4d076a.tar.gz external_skia-fbb38cd17727043aa04957aa5edd7c9fec4d076a.tar.bz2 |
Merge "Fix bug 6888377: crash in GetUnitsPerEm on locale change" into jb-mr1-dev
-rw-r--r-- | src/ports/SkFontHost_FreeType.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index 6aa2120..d77ebb9 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -695,6 +695,13 @@ void SkFontHost::FilterRec(SkScalerContext::Rec* rec) { #ifdef SK_BUILD_FOR_ANDROID uint32_t SkFontHost::GetUnitsPerEm(SkFontID fontID) { SkAutoMutexAcquire ac(gFTMutex); + FT_Library libInit = NULL; + if (gFTCount == 0) { + if (!InitFreetype()) + sk_throw(); + libInit = gFTLibrary; + } + SkAutoTCallIProc<struct FT_LibraryRec_, FT_Done_FreeType> ftLib(libInit); SkFaceRec *rec = ref_ft_face(fontID); uint16_t unitsPerEm = 0; |