https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a999c4374607861cdc5576...
commit a999c4374607861cdc5576e8a9255958e15273f6 Author: Julio Carchi julcar@informaticos.com AuthorDate: Wed Jan 18 13:24:40 2023 -0500 Commit: GitHub noreply@github.com CommitDate: Wed Jan 18 21:24:40 2023 +0300
[NTGDI] Check if face->charmap is not zero before accessing its encoding (#4390)
This allows DevExpress Ribbon Notepad sample to start.
Also add a fat DPRINT1 suggested by Timo Kreuzer, because there is a lot wrong in the code.
CORE-18091 CORE-18558 --- 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 ca1285a4ae7..fcf6f2dfcc7 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -4490,6 +4490,12 @@ ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset) DWORD num_ranges = 0; FT_Face face = Font->SharedFace->Face;
+ if (face->charmap == NULL) + { + DPRINT1("FIXME: No charmap selected! This is a BUG!\n"); + return 0; + } + if (face->charmap->encoding == FT_ENCODING_UNICODE) { FT_UInt glyph_code = 0;