From e90954304d09bc71dd9354e5714bbc8e5a3f3a2e Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Thu, 6 Dec 2018 12:47:02 +0900 Subject: [PATCH] [WIN32SS][FONT] Add some assertions (#1098) --- win32ss/gdi/ntgdi/font.c | 6 +++++- win32ss/gdi/ntgdi/freetype.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/win32ss/gdi/ntgdi/font.c b/win32ss/gdi/ntgdi/font.c index ecf16c6baf5..d106e57ac0d 100644 --- a/win32ss/gdi/ntgdi/font.c +++ b/win32ss/gdi/ntgdi/font.c @@ -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); diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index d6aafb56796..fb823d48d12 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -1631,6 +1631,7 @@ TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont) PLFONT plfont; LOGFONTW *plf; + ASSERT(lf); plfont = LFONT_AllocFontWithHandle(); if (!plfont) {