From cef8a52deae6afd83c6d10ced727929bc199101c Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 17 Jul 2017 23:18:45 +0300 Subject: [PATCH] dwrite: Explicitly check rendering parameters pointer passed to DrawGlyphRun(). Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dwrite/gdiinterop.c | 3 +++ dlls/dwrite/tests/font.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index aa2e3a69773..84921e64a08 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -328,6 +328,9 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac if (!This->dib.ptr) return S_OK; + if (!params) + return E_INVALIDARG; + if (FAILED(hr = IDWriteFontFace_QueryInterface(run->fontFace, &IID_IDWriteFontFace2, (void **)&fontface2))) { WARN("Failed to get IDWriteFontFace2 interface, hr %#x.\n", hr); return hr; diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 52ce9f0dbdc..fe2d802f14d 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -1337,7 +1337,6 @@ static void test_CreateBitmapRenderTarget(void) hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_NATURAL, &run, NULL, RGB(255, 0, 0), NULL); -todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL + 1,