Commit b5dbd180 authored by Haoyang Chen's avatar Haoyang Chen Committed by Alexandre Julliard

dwrite/layout: Handle NULL format in CreateEllipsisTrimmingSign().

parent 6ebbf619
......@@ -5361,6 +5361,9 @@ HRESULT create_trimmingsign(IDWriteFactory7 *factory, IDWriteTextFormat *format,
*sign = NULL;
if (!format)
return E_INVALIDARG;
/* Validate reading/flow direction here, layout creation won't complain about
invalid combinations. */
reading = IDWriteTextFormat_GetReadingDirection(format);
......
......@@ -1321,6 +1321,11 @@ static void test_CreateEllipsisTrimmingSign(void)
DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-GB", &format);
ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr);
sign = (void *)0xdeadbeef;
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, NULL, &sign);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
ok(!sign, "Unexpected pointer %p.\n", sign);
EXPECT_REF(format, 1);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign);
ok(hr == S_OK, "got 0x%08x\n", hr);
......
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