dwrite: Handle font data initialization failure when building collections.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-02-23 17:47:14 +03:00 committed by Alexandre Julliard
parent dcf914857c
commit 7276d5fac1
1 changed files with 6 additions and 2 deletions

View File

@ -387,7 +387,8 @@ static void release_font_data(struct dwrite_font_data *data)
if (data->info_strings[i]) if (data->info_strings[i])
IDWriteLocalizedStrings_Release(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); IDWriteFontFile_Release(data->file);
IDWriteFactory2_Release(data->factory); IDWriteFactory2_Release(data->factory);
@ -3147,8 +3148,11 @@ HRESULT create_font_collection(IDWriteFactory2* factory, IDWriteFontFileEnumerat
/* alloc and init new font data structure */ /* alloc and init new font data structure */
hr = init_font_data(factory, file, face_type, i, &family_name, &font_data); 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; continue;
}
fontstrings_get_en_string(family_name, familyW, sizeof(familyW)/sizeof(WCHAR)); fontstrings_get_en_string(family_name, familyW, sizeof(familyW)/sizeof(WCHAR));