summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2011-05-02 13:49:36 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-10 12:54:55 +0200
commit1787e557e84c12164d22db447b98239b0152457f (patch)
treec810e6050118daf70188289574e3e8fad12f047a /src/3rdparty
parente6e6e4c1695822776957af66413450aaccc0ff65 (diff)
Don't rely on uninitialized data
HB_GetCharAttributes used to require a zero-initialized array for attributes, as it selectively sets relevant bits for each character. We ease that requirement by always initializing the attributes buffer explicitly with memset. Task-number: QT-4911 Reviewed-by: Ritt Konstantin (cherry picked from commit 4cb9db404224c55859713c282aa90409e375c372)
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
index c202e1f52b..3410782453 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
@@ -655,6 +655,7 @@ void HB_GetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength,
const HB_ScriptItem *items, hb_uint32 numItems,
HB_CharAttributes *attributes)
{
+ memset(attributes, 0, stringLength * sizeof(HB_CharAttributes));
calcLineBreaks(string, stringLength, attributes);
for (hb_uint32 i = 0; i < numItems; ++i) {