diff --git a/dlls/gdi32/uniscribe/usp10.c b/dlls/gdi32/uniscribe/usp10.c index 72e75224069..1fda1841533 100644 --- a/dlls/gdi32/uniscribe/usp10.c +++ b/dlls/gdi32/uniscribe/usp10.c @@ -3510,7 +3510,7 @@ HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UIN int iReserved, const WORD *pwGlyphs, int cGlyphs, const int *piAdvance, const int *piJustify, const GOFFSET *pGoffset) { - HRESULT hr = S_OK; + HRESULT hr; INT i, dir = 1; INT *lpDx; WORD *reordered_glyphs = (WORD *)pwGlyphs; @@ -3521,6 +3521,7 @@ HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UIN if (!hdc || !psc) return E_INVALIDARG; if (!piAdvance || !psa || !pwGlyphs) return E_INVALIDARG; + if ((hr = init_script_cache(hdc, psc)) != S_OK) return hr; fuOptions &= ETO_CLIPPED | ETO_OPAQUE; fuOptions |= ETO_IGNORELANGUAGE; diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 7516bfb2a97..92b26e56392 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -2777,6 +2777,7 @@ static void test_ScriptTextOut(HDC hdc) hr = ScriptTextOut(hdc, &psc, 0, 0, 0, NULL, &pItem[0].a, NULL, 0, pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!!psc, "Got unexpected psc %p.\n", psc); /* Test Rect Rgn is acceptable. */ SetRect(&rect, 10, 10, 40, 20);