From 7276d5fac1417dd81344db45b3af904f8f2c7d77 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 23 Feb 2016 17:47:14 +0300 Subject: [PATCH] dwrite: Handle font data initialization failure when building collections. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dwrite/font.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 05b5f555d3e..c0e0e437ac9 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -387,7 +387,8 @@ static void release_font_data(struct dwrite_font_data *data) if (data->info_strings[i]) IDWriteLocalizedStrings_Release(data->info_strings[i]); } - IDWriteLocalizedStrings_Release(data->names); + if (data->names) + IDWriteLocalizedStrings_Release(data->names); IDWriteFontFile_Release(data->file); IDWriteFactory2_Release(data->factory); @@ -3147,8 +3148,11 @@ HRESULT create_font_collection(IDWriteFactory2* factory, IDWriteFontFileEnumerat /* alloc and init new font data structure */ hr = init_font_data(factory, file, face_type, i, &family_name, &font_data); - if (FAILED(hr)) + if (FAILED(hr)) { + /* move to next one */ + hr = S_OK; continue; + } fontstrings_get_en_string(family_name, familyW, sizeof(familyW)/sizeof(WCHAR));