summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-04-10 12:48:01 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-04-10 15:31:45 +0200
commit143c4d3e13a430b951f4f4f8c28db14303f80605 (patch)
tree2b89637b93fc7d81c674106008566010f986d67c /src/3rdparty
parenta7ed81b557d593a8ddb43b71bf4bbf3b44ead070 (diff)
parente5337ad1b1fb02873ce7b5ca8db45f6fd8063352 (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-thai.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
index bf6c35b19c..3c0ffe8358 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
@@ -263,8 +263,13 @@ static HB_Bool HB_ThaiConvertStringToGlyphIndices (HB_ShaperItem *item)
// The only glyphs that should be passed to this function that cannot be mapped to
// tis620 are the ones of type Inherited class. Pass these glyphs untouched.
glyphString[slen++] = string[i];
- if (string[i] == 0x200D || string[i] == 0x200C)
- item->attributes[slen-1].dontPrint = true; // Hide ZWJ and ZWNJ characters
+ if (string[i] == 0x200D || string[i] == 0x200C) {
+ // Check that we do not run out of bounds when setting item->attributes. If we do
+ // run out of bounds then this function will return false, the necessary amount of
+ // memory is reallocated, and this function will then be called again.
+ if (slen <= item->num_glyphs)
+ item->attributes[slen-1].dontPrint = true; // Hide ZWJ and ZWNJ characters
+ }
} else {
glyphString[slen++] = (HB_UChar16) thai_get_glyph_index (font_type, rglyphs[lgi]);
}