https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fb7ac93dd167e85a918b4254440bc2314d295610

commit fb7ac93dd167e85a918b4254440bc2314d295610
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Wed Dec 25 18:27:44 2019 +0900
Commit:     GitHub <[email protected]>
CommitDate: Wed Dec 25 18:27:44 2019 +0900

    [WIN32SS][NTGDI][FREETYPE] Add ASSERT(pOS2); to FillTM (#2170)
    
    I had used a static analyzer cppcheck to improve the code. This analyzer 
suggested NULL check for this code.
---
 win32ss/gdi/ntgdi/freetype.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index 2a019dd70f8..e94534b2b5e 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -2272,6 +2272,10 @@ FillTM(TEXTMETRICW *TM, PFONTGDI FontGDI,
         return;
     }
 
+    ASSERT(pOS2);
+    if (!pOS2)
+        return;
+
     if ((FT_Short)pOS2->usWinAscent + (FT_Short)pOS2->usWinDescent == 0)
     {
         Ascent = pHori->Ascender;

Reply via email to