https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e90954304d09bc71dd935…
commit e90954304d09bc71dd9354e5714bbc8e5a3f3a2e
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Dec 6 12:47:02 2018 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Dec 6 12:47:02 2018 +0900
[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 ecf16c6baf..d106e57ac0 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 d6aafb5679..fb823d48d1 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)
{