dwrite: Handle NULL path in CreateFontFileReference().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8b8098461d
commit
af18a09862
|
@ -4399,6 +4399,9 @@ HRESULT get_local_refkey(const WCHAR *path, const FILETIME *writetime, void **ke
|
||||||
{
|
{
|
||||||
struct local_refkey *refkey;
|
struct local_refkey *refkey;
|
||||||
|
|
||||||
|
if (!path)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
*size = FIELD_OFFSET(struct local_refkey, name) + (strlenW(path)+1)*sizeof(WCHAR);
|
*size = FIELD_OFFSET(struct local_refkey, name) + (strlenW(path)+1)*sizeof(WCHAR);
|
||||||
*key = NULL;
|
*key = NULL;
|
||||||
|
|
||||||
|
|
|
@ -778,6 +778,8 @@ static HRESULT WINAPI dwritefactory_CreateFontFileReference(IDWriteFactory3 *ifa
|
||||||
|
|
||||||
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(path), writetime, font_file);
|
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(path), writetime, font_file);
|
||||||
|
|
||||||
|
*font_file = NULL;
|
||||||
|
|
||||||
if (!This->localfontfileloader)
|
if (!This->localfontfileloader)
|
||||||
{
|
{
|
||||||
hr = create_localfontfileloader(&This->localfontfileloader);
|
hr = create_localfontfileloader(&This->localfontfileloader);
|
||||||
|
|
|
@ -2599,6 +2599,11 @@ static void test_CreateFontFileReference(void)
|
||||||
path = create_testfontfile(test_fontfile);
|
path = create_testfontfile(test_fontfile);
|
||||||
factory = create_factory();
|
factory = create_factory();
|
||||||
|
|
||||||
|
ffile = (void*)0xdeadbeef;
|
||||||
|
hr = IDWriteFactory_CreateFontFileReference(factory, NULL, NULL, &ffile);
|
||||||
|
ok(hr == E_INVALIDARG, "got 0x%08x\n",hr);
|
||||||
|
ok(ffile == NULL, "got %p\n", ffile);
|
||||||
|
|
||||||
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &ffile);
|
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &ffile);
|
||||||
ok(hr == S_OK, "got 0x%08x\n",hr);
|
ok(hr == S_OK, "got 0x%08x\n",hr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue