diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2010-06-25 08:32:47 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2010-06-25 08:36:16 (GMT) |
commit | 79342a635d71d1612795ab878b145f6e95ab23d2 (patch) | |
tree | 1fd30f738304ae3b27b0e4346317bb005444c22d /src/3rdparty/harfbuzz | |
parent | f5b2318940db51e0f76e7673116050df8e4d8e3c (diff) | |
download | Qt-79342a635d71d1612795ab878b145f6e95ab23d2.zip Qt-79342a635d71d1612795ab878b145f6e95ab23d2.tar.gz Qt-79342a635d71d1612795ab878b145f6e95ab23d2.tar.bz2 |
Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to 4b88f595ab62b7c5f703a286c4f5f13f8784a936
* Fix crash/regression in thai line word breaking when libthai is installed:
Commit 4b88f595ab62b7c5f703a286c4f5f13f8784a936 upstream ensures the zero
termination of the string passed to libthai.
Diffstat (limited to 'src/3rdparty/harfbuzz')
-rw-r--r-- | src/3rdparty/harfbuzz/src/harfbuzz-thai.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c index fc2bdbf..e153ba9 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c @@ -53,6 +53,8 @@ static void to_tis620(const HB_UChar16 *string, hb_uint32 len, const char *cstr) else result[i] = '?'; } + + result[len] = 0; } static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttributes *attributes) @@ -70,8 +72,8 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri if (!th_brk) return; - if (len > 128) - cstr = (char *)malloc(len*sizeof(char)); + if (len >= 128) + cstr = (char *)malloc(len*sizeof(char) + 1); to_tis620(string, len, cstr); @@ -96,7 +98,7 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri if (break_positions != brp) free(break_positions); - if (len > 128) + if (len >= 128) free(cstr); } |