summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-05-25 22:43:29 +0200
committerCaolán McNamara <caolanm@redhat.com>2012-05-30 21:00:51 +0100
commit6b7bea515ef8e762829b25b97fd84559186dd92c (patch)
treee44cd953ca24131d12577bb1f87a8c87de33aa02
parent6e7657eb87cf97df3aa40cb662963d6d85816ad5 (diff)
fdo#50169: band-aid another crash in GraphiteLayout::expandOrCondense:
error: attempt to subscript container with out-of-bounds index 6, but container only holds 6 elements. (cherry picked from commit b8452a89ceaa9008558b83f3a8b6937d14b7c803) Signed-off-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 7a240bf5d05d..fd46d22c1b0a 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -845,7 +845,11 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
nOffset = static_cast<int>(fExtraPerCluster * nCluster);
int nCharIndex = mvGlyph2Char[i];
assert(nCharIndex > -1);
- mvCharDxs[nCharIndex-mnMinCharPos] += nOffset;
+ if (static_cast<size_t>(nCharIndex-mnMinCharPos)
+ < mvCharDxs.size())
+ {
+ mvCharDxs[nCharIndex-mnMinCharPos] += nOffset;
+ }
// adjust char dxs for rest of characters in cluster
while (++nCharIndex - mnMinCharPos < static_cast<int>(mvChar2BaseGlyph.size()))
{