mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 03:12:59 +00:00
[0.4.14][NTGDI] Check if face->charmap is not zero before accessing its encoding (#4390)
Prevents a BSOD 0x1E upon dereference.
CORE-18091 CORE-18558
By partially porting back:
0.4.15-dev-5587-ga999c43 a999c43746
and take also some cosmetic changes from master head, like EOL-whitespace-removal.
This commit is contained in:
parent
69eb10692a
commit
497261a758
1 changed files with 11 additions and 12 deletions
|
@ -2197,9 +2197,7 @@ FillTM(TEXTMETRICW *TM, PFONTGDI FontGDI,
|
|||
|
||||
TM->tmAveCharWidth = (FT_MulFix(pOS2->xAvgCharWidth, XScale) + 32) >> 6;
|
||||
if (TM->tmAveCharWidth == 0)
|
||||
{
|
||||
TM->tmAveCharWidth = 1;
|
||||
}
|
||||
|
||||
/* Correct forumla to get the maxcharwidth from unicode and ansi font */
|
||||
TM->tmMaxCharWidth = (FT_MulFix(Face->max_advance_width, XScale) + 32) >> 6;
|
||||
|
@ -4477,6 +4475,9 @@ ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset)
|
|||
DWORD num_ranges = 0;
|
||||
FT_Face face = Font->SharedFace->Face;
|
||||
|
||||
if (face->charmap == NULL)
|
||||
return 0;
|
||||
|
||||
if (face->charmap->encoding == FT_ENCODING_UNICODE)
|
||||
{
|
||||
FT_UInt glyph_code = 0;
|
||||
|
@ -6441,7 +6442,6 @@ IntExtTextOutW(
|
|||
if (!HSourceGlyph)
|
||||
{
|
||||
DPRINT1("WARNING: EngCreateBitmap() failed!\n");
|
||||
// FT_Done_Glyph(realglyph);
|
||||
bResult = FALSE;
|
||||
break;
|
||||
}
|
||||
|
@ -6586,7 +6586,6 @@ IntExtTextOutW(
|
|||
EXLATEOBJ_vCleanup(&exloDst2RGB);
|
||||
|
||||
Cleanup:
|
||||
|
||||
DC_vFinishBlit(dc, NULL);
|
||||
|
||||
if (TextObj != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue