[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
This commit is contained in:
Julio Carchi 2023-01-18 13:24:40 -05:00 committed by GitHub
parent 346477fb3c
commit a999c43746
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;