Module: wine Branch: master Commit: 1f4554d141774e948a29731db72ce5758ddad2f5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1f4554d141774e948a29731db7...
Author: Aric Stewart aric@codeweavers.com Date: Fri May 25 07:55:19 2012 -0500
usp10: Check bounds before checking value in array.
---
dlls/usp10/shape.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index a039504..d582fc7 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -628,9 +628,9 @@ static void UpdateClustersFromGlyphProp(const int cGlyphs, const int cChars, WOR if (pwLogClust[j] == i) { int k = j; - while (!pGlyphProp[pwLogClust[k]].sva.fClusterStart && k >= 0 && k <cChars) + while (k >= 0 && k <cChars && !pGlyphProp[pwLogClust[k]].sva.fClusterStart) k-=1; - if (pGlyphProp[pwLogClust[k]].sva.fClusterStart) + if (k >= 0 && k <cChars && pGlyphProp[pwLogClust[k]].sva.fClusterStart) pwLogClust[j] = pwLogClust[k]; } }