Commit b5ca1aaa authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Michael Stefaniuc

dwrite: Always initialize context and font table pointers.

Signed-off-by: 's avatarNikolay Sivov <nsivov@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org> (cherry picked from commit 7cac7bb9) Signed-off-by: 's avatarMichael Stefaniuc <mstefani@winehq.org>
parent 8de4c8ca
......@@ -809,6 +809,9 @@ HRESULT opentype_get_font_table(IDWriteFontFileStream *stream, DWRITE_FONT_FACE_
if (found) *found = FALSE;
if (table_size) *table_size = 0;
*table_data = NULL;
*table_context = NULL;
if (type == DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION) {
const TTC_Header_V1 *ttc_header;
void * ttc_context;
......
......@@ -2725,6 +2725,15 @@ static void test_TryGetFontTable(void)
IDWriteFontFace_ReleaseFontTable(fontface, context2);
IDWriteFontFace_ReleaseFontTable(fontface, context);
/* table does not exist */
exists = TRUE;
context = (void*)0xdeadbeef;
table = (void*)0xdeadbeef;
hr = IDWriteFontFace_TryGetFontTable(fontface, 0xabababab, &table, &size, &context, &exists);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(exists == FALSE, "got %d\n", exists);
ok(context == NULL && table == NULL, "got context %p, table pointer %p\n", context, table);
IDWriteFontFace_Release(fontface);
IDWriteFontFile_Release(file);
IDWriteFactory_Release(factory);
......
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