[WIN32SS][FONT] Add some assertions (#1098)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Thu, 6 Dec 2018 03:47:02 +0000 (12:47 +0900)
committerGitHub <noreply@github.com>
Thu, 6 Dec 2018 03:47:02 +0000 (12:47 +0900)
win32ss/gdi/ntgdi/font.c
win32ss/gdi/ntgdi/freetype.c

index ecf16c6..d106e57 100644 (file)
@@ -293,7 +293,10 @@ FASTCALL
 FontGetObject(PTEXTOBJ plfont, ULONG cjBuffer, PVOID pvBuffer)
 {
     ULONG cjMaxSize;
-    ENUMLOGFONTEXDVW *plf = &plfont->logfont;
+    ENUMLOGFONTEXDVW *plf;
+
+    ASSERT(plfont);
+    plf = &plfont->logfont;
 
     if (!(plfont->fl & TEXTOBJECT_INIT))
     {
@@ -1081,6 +1084,7 @@ NtGdiGetRealizationInfo(
   }
   pdcattr = pDc->pdcattr;
   pTextObj = RealizeFontInit(pdcattr->hlfntNew);
+  ASSERT(pTextObj != NULL);
   pFontGdi = ObjToGDI(pTextObj->Font, FONT);
   TEXTOBJ_UnlockText(pTextObj);
   DC_UnlockDc(pDc);
index d6aafb5..fb823d4 100644 (file)
@@ -1631,6 +1631,7 @@ TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont)
     PLFONT plfont;
     LOGFONTW *plf;
 
+    ASSERT(lf);
     plfont = LFONT_AllocFontWithHandle();
     if (!plfont)
     {