diff --git a/ChangeLog b/ChangeLog index 774ca76..308e715 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2008-11-20 Richard Frith-Macdonald +2008-12-17 Fred Kiefer + + * Source/winlib/WIN32FontInfo.m (-coveredCharacterSet): Set cbThis + element of GLYPHSET structure before calling Windows funtion. + +2008-12-17 Richard Frith-Macdonald * Tools/gpbs.m: Remove use of private method for connection keepalive. Keepalive is now enabled in base when necessary. diff --git a/Source/winlib/WIN32FontInfo.m b/Source/winlib/WIN32FontInfo.m index ea750ff..78a5cc9 100644 --- a/Source/winlib/WIN32FontInfo.m +++ b/Source/winlib/WIN32FontInfo.m @@ -201,12 +201,24 @@ NSLog(@"No glyph for U%d", c); HFONT old; ms = [NSMutableCharacterSet new]; + if (!ms) + return nil; + hdc = CreateCompatibleDC(NULL); old = SelectObject(hdc, hFont); count = (unsigned)GetFontUnicodeRanges(hdc, 0); if (count > 0) { gs = (GLYPHSET*)objc_malloc(count); + if (!gs) + { + SelectObject(hdc, old); + DeleteDC(hdc); + RELEASE(ms); + return nil; + } + + gs->cbThis = count; if ((unsigned)GetFontUnicodeRanges(hdc, gs) == count) { numberOfGlyphs = gs->cGlyphsSupported;