Commit 14d5e68f authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Cope with OpenFontFile failing.

parent 82103fe7
...@@ -1605,11 +1605,14 @@ static void free_font(GdiFont font) ...@@ -1605,11 +1605,14 @@ static void free_font(GdiFont font)
struct list *first_hfont; struct list *first_hfont;
HFONTLIST *hfontlist; HFONTLIST *hfontlist;
list_remove(cursor); list_remove(cursor);
first_hfont = list_head(&child->font->hfontlist); if(child->font)
hfontlist = LIST_ENTRY(first_hfont, HFONTLIST, entry); {
DeleteObject(hfontlist->hfont); first_hfont = list_head(&child->font->hfontlist);
HeapFree(GetProcessHeap(), 0, hfontlist); hfontlist = LIST_ENTRY(first_hfont, HFONTLIST, entry);
free_font(child->font); DeleteObject(hfontlist->hfont);
HeapFree(GetProcessHeap(), 0, hfontlist);
free_font(child->font);
}
HeapFree(GetProcessHeap(), 0, child->file_name); HeapFree(GetProcessHeap(), 0, child->file_name);
HeapFree(GetProcessHeap(), 0, child); HeapFree(GetProcessHeap(), 0, child);
} }
...@@ -3292,7 +3295,11 @@ static BOOL load_child_font(GdiFont font, CHILD_FONT *child) ...@@ -3292,7 +3295,11 @@ static BOOL load_child_font(GdiFont font, CHILD_FONT *child)
child->font = alloc_font(); child->font = alloc_font();
child->font->ft_face = OpenFontFile(child->font, child->file_name, child->index, 0, -font->ppem); child->font->ft_face = OpenFontFile(child->font, child->file_name, child->index, 0, -font->ppem);
if(!child->font->ft_face) if(!child->font->ft_face)
{
free_font(child->font);
child->font = NULL;
return FALSE; return FALSE;
}
child->font->orientation = font->orientation; child->font->orientation = font->orientation;
hfontlist = HeapAlloc(GetProcessHeap(), 0, sizeof(*hfontlist)); hfontlist = HeapAlloc(GetProcessHeap(), 0, sizeof(*hfontlist));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment