Commit f50f05da authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

usp10: Limit runs in ScriptStringAnalyse to 255.

parent 4df49291
...@@ -1772,19 +1772,12 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, ...@@ -1772,19 +1772,12 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString,
hr = ScriptItemize(pString, cString, num_items, &sControl, &sState, analysis->pItem, hr = ScriptItemize(pString, cString, num_items, &sControl, &sState, analysis->pItem,
&analysis->numItems); &analysis->numItems);
while (hr == E_OUTOFMEMORY) if FAILED(hr)
{ {
SCRIPT_ITEM *tmp; if (hr == E_OUTOFMEMORY)
hr = E_INVALIDARG;
num_items *= 2;
if (!(tmp = heap_realloc_zero(analysis->pItem, num_items * sizeof(SCRIPT_ITEM) + 1)))
goto error; goto error;
analysis->pItem = tmp;
hr = ScriptItemize(pString, cString, num_items, psControl, psState, analysis->pItem,
&analysis->numItems);
} }
if (hr != S_OK) goto error;
/* set back to out of memory for default goto error behaviour */ /* set back to out of memory for default goto error behaviour */
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
......
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