[FONT][WIN32SS] Follow-up of #1184
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Tue, 25 Dec 2018 12:51:58 +0000 (21:51 +0900)
committerKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Tue, 25 Dec 2018 12:54:33 +0000 (21:54 +0900)
win32ss/gdi/ntgdi/freetype.c

index 85ad7ce..0bdc407 100644 (file)
@@ -5813,10 +5813,13 @@ GreExtTextOutW(
         {
             glyph_index = get_glyph_index_flagged(face, String[i], ETO_GLYPH_INDEX, fuOptions);
 
+            // FIXME: Use FT_LOAD_BITMAP_METRICS_ONLY or cache.
             error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
             if (error)
             {
-                DPRINT1("WARNING: Failed to load and render glyph! [index: %d]\n", glyph_index);
+                DPRINT1("Failed to load glyph! [index: %d]\n", glyph_index);
+                IntUnLockFreeType();
+                goto Cleanup;
             }
 
             glyph = face->glyph;
@@ -5828,6 +5831,8 @@ GreExtTextOutW(
             if (!realglyph)
             {
                 DPRINT1("Failed to render glyph! [index: %d]\n", glyph_index);
+                IntUnLockFreeType();
+                goto Cleanup;
             }
 
             /* retrieve kerning distance and move pen position */