mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 09:41:41 +00:00
wineps: Cope correctly with a missing table.
Signed-off-by: Wolfgang Walter <wine@stwm.de> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b5606045bc
commit
2b23eb2e9a
|
@ -100,10 +100,15 @@ struct tagTYPE42 {
|
||||||
static BOOL LoadTable(HDC hdc, OTTable *table)
|
static BOOL LoadTable(HDC hdc, OTTable *table)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
DWORD len;
|
||||||
|
|
||||||
if(table->MS_tag == MS_MAKE_TAG('g','d','i','r')) return TRUE;
|
if(table->MS_tag == MS_MAKE_TAG('g','d','i','r')) return TRUE;
|
||||||
table->len = GetFontData(hdc, table->MS_tag, 0, NULL, 0);
|
table->len = 0;
|
||||||
table->data = HeapAlloc(GetProcessHeap(), 0, (table->len + 3) & ~3 );
|
len = GetFontData(hdc, table->MS_tag, 0, NULL, 0);
|
||||||
|
if(len == GDI_ERROR) return FALSE;
|
||||||
|
table->data = HeapAlloc(GetProcessHeap(), 0, (len + 3) & ~3);
|
||||||
|
if(!table->data) return FALSE;
|
||||||
|
table->len = len;
|
||||||
memset(table->data + ((table->len - 1) & ~3), 0, sizeof(DWORD));
|
memset(table->data + ((table->len - 1) & ~3), 0, sizeof(DWORD));
|
||||||
GetFontData(hdc, table->MS_tag, 0, table->data, table->len);
|
GetFontData(hdc, table->MS_tag, 0, table->data, table->len);
|
||||||
table->check = 0;
|
table->check = 0;
|
||||||
|
|
Loading…
Reference in a new issue