Commit cef8a52d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Explicitly check rendering parameters pointer passed to DrawGlyphRun().

parent 1e5b9d36
...@@ -328,6 +328,9 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac ...@@ -328,6 +328,9 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac
if (!This->dib.ptr) if (!This->dib.ptr)
return S_OK; return S_OK;
if (!params)
return E_INVALIDARG;
if (FAILED(hr = IDWriteFontFace_QueryInterface(run->fontFace, &IID_IDWriteFontFace2, (void **)&fontface2))) { if (FAILED(hr = IDWriteFontFace_QueryInterface(run->fontFace, &IID_IDWriteFontFace2, (void **)&fontface2))) {
WARN("Failed to get IDWriteFontFace2 interface, hr %#x.\n", hr); WARN("Failed to get IDWriteFontFace2 interface, hr %#x.\n", hr);
return hr; return hr;
......
...@@ -1337,7 +1337,6 @@ static void test_CreateBitmapRenderTarget(void) ...@@ -1337,7 +1337,6 @@ static void test_CreateBitmapRenderTarget(void)
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_NATURAL, hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_NATURAL,
&run, NULL, RGB(255, 0, 0), NULL); &run, NULL, RGB(255, 0, 0), NULL);
todo_wine
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL + 1, hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL + 1,
......
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