diff options
Diffstat (limited to 'Build/source/libs/icu/icu-4.6-PATCHES/patch-81-Indic')
-rw-r--r-- | Build/source/libs/icu/icu-4.6-PATCHES/patch-81-Indic | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Build/source/libs/icu/icu-4.6-PATCHES/patch-81-Indic b/Build/source/libs/icu/icu-4.6-PATCHES/patch-81-Indic new file mode 100644 index 00000000000..4e50d93022a --- /dev/null +++ b/Build/source/libs/icu/icu-4.6-PATCHES/patch-81-Indic @@ -0,0 +1,56 @@ + Make sure the loop over SplitMatra pieces stays within array bounds. + + Remove some trailing white space. + +diff -ur icu-4.6.orig/source/layout/IndicReordering.cpp icu-4.6/source/layout/IndicReordering.cpp +--- icu-4.6.orig/source/layout/IndicReordering.cpp 2009-10-08 21:13:13.000000000 +0200 ++++ icu-4.6/source/layout/IndicReordering.cpp 2011-02-22 10:35:06.000000000 +0100 +@@ -235,13 +235,13 @@ + + for ( i = beginSyllable ; i < nextSyllable ; i++ ) { + if ( classTable->isMatra(fOutChars[i+inv_count])) { +- IndicClassTable::CharClass matraClass = classTable->getCharClass(fOutChars[i+inv_count]); ++ IndicClassTable::CharClass matraClass = classTable->getCharClass(fOutChars[i+inv_count]); + if ( classTable->isSplitMatra(matraClass)) { + le_int32 saveIndex = fGlyphStorage.getCharIndex(i+inv_count,success); + le_uint32 saveAuxData = fGlyphStorage.getAuxData(i+inv_count,success); + const SplitMatra *splitMatra = classTable->getSplitMatra(matraClass); + int j; +- for (j = 0 ; *(splitMatra)[j] != 0 ; j++) { ++ for (j = 0 ; j < SM_MAX_PIECES && *(splitMatra)[j] != 0 ; j++) { + LEUnicode piece = (*splitMatra)[j]; + if ( j == 0 ) { + fOutChars[i+inv_count] = piece; +@@ -252,7 +252,7 @@ + } + } + } +- ++ + if ((matraClass & CF_POS_MASK) == CF_POS_BEFORE) { + moveCharacter(i+inv_count,beginSyllable+inv_count); + } +@@ -332,7 +332,7 @@ + const SplitMatra *splitMatra = classTable->getSplitMatra(matraClass); + int i; + +- for (i = 0; i < 3 && (*splitMatra)[i] != 0; i += 1) { ++ for (i = 0; i < SM_MAX_PIECES && (*splitMatra)[i] != 0; i += 1) { + LEUnicode piece = (*splitMatra)[i]; + IndicClassTable::CharClass pieceClass = classTable->getCharClass(piece); + +diff -ur icu-4.6.orig/source/layout/IndicReordering.h icu-4.6/source/layout/IndicReordering.h +--- icu-4.6.orig/source/layout/IndicReordering.h 2009-06-11 20:34:01.000000000 +0200 ++++ icu-4.6/source/layout/IndicReordering.h 2011-02-22 10:22:43.000000000 +0100 +@@ -71,7 +71,10 @@ + #define SF_POST_BASE_LIMIT_MASK 0x0000FFFFU + #define SF_NO_POST_BASE_LIMIT 0x00007FFFU + +-typedef LEUnicode SplitMatra[3]; ++// Max number of split matra pieces ++#define SM_MAX_PIECES 3 ++ ++typedef LEUnicode SplitMatra[SM_MAX_PIECES]; + + class MPreFixups; + class LEGlyphStorage; |