usp10: Avoid an end of buffer overrun when seeking non space characters at an end of a BiDi string.

This commit is contained in:
Aric Stewart 2011-11-08 09:31:57 -06:00 committed by Alexandre Julliard
parent 78e4d3d25c
commit 38aa7696c5
1 changed files with 4 additions and 1 deletions

View File

@ -856,7 +856,10 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int
int j = 1;
while (cnt + j < cInChars - 1 && (pwcInChars[cnt+j] == Numeric_space || pwcInChars[cnt+j] == ZWJ || pwcInChars[cnt+j] == ZWNJ))
j++;
New_Script = get_char_script(pwcInChars[cnt+j]);
if (cnt + j < cInChars)
New_Script = get_char_script(pwcInChars[cnt+j]);
else
New_Script = get_char_script(pwcInChars[cnt]);
}
if ((levels && (levels[cnt] != pItems[index].a.s.uBidiLevel || (strength && (strength[cnt] != str)))) || (New_Script != -1 && New_Script != pItems[index].a.eScript) || New_Script == Script_Control)