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:
Wolfgang Walter 2018-11-12 10:56:10 +00:00 committed by Alexandre Julliard
parent b5606045bc
commit 2b23eb2e9a
1 changed files with 7 additions and 2 deletions

View File

@ -100,10 +100,15 @@ struct tagTYPE42 {
static BOOL LoadTable(HDC hdc, OTTable *table)
{
unsigned int i;
DWORD len;
if(table->MS_tag == MS_MAKE_TAG('g','d','i','r')) return TRUE;
table->len = GetFontData(hdc, table->MS_tag, 0, NULL, 0);
table->data = HeapAlloc(GetProcessHeap(), 0, (table->len + 3) & ~3 );
table->len = 0;
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));
GetFontData(hdc, table->MS_tag, 0, table->data, table->len);
table->check = 0;