https://git.reactos.org/?p=reactos.git;a=commitdiff;h=436d8d962ae3e75020c6b…
commit 436d8d962ae3e75020c6b93f3acba2ea0316daa5
Author:     Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sat Dec 29 19:45:09 2018 +0100
Commit:     Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Dec 29 19:46:59 2018 +0100
    [FONT][WIN32SS] Hold the freetype lock while accessing freetype data
---
 win32ss/gdi/ntgdi/freetype.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index 8ab25b94a9..7e7e132285 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -4142,10 +4142,9 @@ ftGdiGetTextCharsetInfo(
     Face = FontGdi->SharedFace->Face;
     TEXTOBJ_UnlockText(TextObj);
+    memset(&fs, 0, sizeof(FONTSIGNATURE));
     IntLockFreeType();
     pOS2 = FT_Get_Sfnt_Table(Face, ft_sfnt_os2);
-    IntUnLockFreeType();
-    memset(&fs, 0, sizeof(FONTSIGNATURE));
     if (NULL != pOS2)
     {
         fs.fsCsb[0] = pOS2->ulCodePageRange1;
@@ -4164,6 +4163,8 @@ ftGdiGetTextCharsetInfo(
                 fs.fsCsb[0] |= FS_SYMBOL;
         }
     }
+    pOS2 = NULL;
+    IntUnLockFreeType();
     DPRINT("Csb 1=%x  0=%x\n", fs.fsCsb[1],fs.fsCsb[0]);
     if (fs.fsCsb[0] == 0)
     { /* Let's see if we can find any interesting cmaps */