diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index eef7cb3e5c..2d3eaaba62 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -6884,6 +6884,7 @@ NtGdiGetGlyphIndicesW( PWSTR Safepwc = NULL; LPCWSTR UnSafepwc = pwc; LPWORD UnSafepgi = pgi; + SIZE_T DataSize; /* Check for integer overflow */ if (cwc & 0x80000000) // (INT_MAX + 1) == INT_MIN @@ -6905,13 +6906,6 @@ NtGdiGetGlyphIndicesW( return 0; } - // FIXME: This is a hack!! (triggered by e.g. Word 2010). See CORE-12825 - if (cwc == 0) - { - DPRINT1("ERR: NtGdiGetGlyphIndicesW with (cwc == 0) is UNIMPLEMENTED!\n"); - return GDI_ERROR; - } - dc = DC_LockDc(hdc); if (!dc) { @@ -6929,7 +6923,8 @@ NtGdiGetGlyphIndicesW( FontGDI = ObjToGDI(TextObj->Font, FONT); TEXTOBJ_UnlockText(TextObj); - Buffer = ExAllocatePoolWithTag(PagedPool, cwc*sizeof(WORD), GDITAG_TEXT); + DataSize = (cwc ? cwc * sizeof(WORD) : 1); + Buffer = ExAllocatePoolWithTag(PagedPool, DataSize, GDITAG_TEXT); if (!Buffer) { return GDI_ERROR;