Aric Stewart : usp10: Limit runs in ScriptStringAnalyse to 255.
Module: wine Branch: master Commit: f50f05da231ab5f1f463cd5ba929bb77009d1141 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f50f05da231ab5f1f463cd5ba9... Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jan 30 07:30:15 2012 -0600 usp10: Limit runs in ScriptStringAnalyse to 255. --- dlls/usp10/usp10.c | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index beecce9..1342303 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -1772,19 +1772,12 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, hr = ScriptItemize(pString, cString, num_items, &sControl, &sState, analysis->pItem, &analysis->numItems); - while (hr == E_OUTOFMEMORY) + if FAILED(hr) { - SCRIPT_ITEM *tmp; - - num_items *= 2; - if (!(tmp = heap_realloc_zero(analysis->pItem, num_items * sizeof(SCRIPT_ITEM) + 1))) - goto error; - - analysis->pItem = tmp; - hr = ScriptItemize(pString, cString, num_items, psControl, psState, analysis->pItem, - &analysis->numItems); + if (hr == E_OUTOFMEMORY) + hr = E_INVALIDARG; + goto error; } - if (hr != S_OK) goto error; /* set back to out of memory for default goto error behaviour */ hr = E_OUTOFMEMORY;
participants (1)
-
Alexandre Julliard