Commit 73bec118 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

usp10: Do not crash in ScriptPlace if pABC is null.

parent 621eceb6
...@@ -1309,7 +1309,7 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, ...@@ -1309,7 +1309,7 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs,
* to get the correct ABC widths. */ * to get the correct ABC widths. */
if (!(lpABC = usp_zero_alloc(sizeof(ABC) * cGlyphs))) return E_OUTOFMEMORY; if (!(lpABC = usp_zero_alloc(sizeof(ABC) * cGlyphs))) return E_OUTOFMEMORY;
if (pABC)
memset(pABC, 0, sizeof(ABC)); memset(pABC, 0, sizeof(ABC));
/* FIXME: set pGoffset to more reasonable values */ /* FIXME: set pGoffset to more reasonable values */
...@@ -1330,14 +1330,18 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, ...@@ -1330,14 +1330,18 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs,
lpABC[wcnt].abcA, lpABC[wcnt].abcA,
lpABC[wcnt].abcB, lpABC[wcnt].abcB,
lpABC[wcnt].abcC, wcnt); lpABC[wcnt].abcC, wcnt);
if (pABC)
{
pABC->abcA += lpABC[wcnt].abcA; pABC->abcA += lpABC[wcnt].abcA;
pABC->abcB += lpABC[wcnt].abcB; pABC->abcB += lpABC[wcnt].abcB;
pABC->abcC += lpABC[wcnt].abcC; pABC->abcC += lpABC[wcnt].abcC;
}
piAdvance[wcnt] = lpABC[wcnt].abcA + lpABC[wcnt].abcB + lpABC[wcnt].abcC; piAdvance[wcnt] = lpABC[wcnt].abcA + lpABC[wcnt].abcB + lpABC[wcnt].abcC;
pGoffset[wcnt].du = 0; pGoffset[wcnt].du = 0;
pGoffset[wcnt].dv = 0; pGoffset[wcnt].dv = 0;
} }
} }
if (pABC)
TRACE("Total for run: abcA=%d, abcB=%d, abcC=%d\n", pABC->abcA, pABC->abcB, pABC->abcC); TRACE("Total for run: abcA=%d, abcB=%d, abcC=%d\n", pABC->abcA, pABC->abcB, pABC->abcC);
usp_free(lpABC); usp_free(lpABC);
......
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