https://git.reactos.org/?p=reactos.git;a=commitdiff;h=52fb8c1a8d1d1ef2ddb46c...
commit 52fb8c1a8d1d1ef2ddb46c017b461011b26188ee Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Thu Apr 23 22:02:41 2020 +0900 Commit: GitHub noreply@github.com CommitDate: Thu Apr 23 22:02:41 2020 +0900
[NTGDI][FREETYPE] Return non-zero gm.gmBlackBoxX/Y (#2643)
In return of GetGlyphOutline function call, gm.gmBlackBoxX and gm.gmBlackBoxY must be non-zero to avoid Division by Zero. At epilogue of ftGdiGetGlyphOutline, we adjust the values. CORE-15949 --- win32ss/gdi/ntgdi/freetype.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 7d646807e7b..c53bf1a12aa 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -4203,6 +4203,12 @@ ftGdiGetGlyphOutline( }
DPRINT("ftGdiGetGlyphOutline END and needed %lu\n", needed); + + if (gm.gmBlackBoxX == 0) + gm.gmBlackBoxX = 1; + if (gm.gmBlackBoxY == 0) + gm.gmBlackBoxY = 1; + *pgm = gm; return needed; }