summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-05-25 22:43:29 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-25 23:24:15 +0200
commitb8452a89ceaa9008558b83f3a8b6937d14b7c803 (patch)
tree0a190492815f27c80e4c137b7d710cb709178009
parentb6db1e0683c8fac594a606297f16b1fe163ed15b (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.
-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 4edeb9af731e..429e700afa50 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -849,7 +849,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()))
{