From b8452a89ceaa9008558b83f3a8b6937d14b7c803 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 25 May 2012 22:43:29 +0200 Subject: 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. --- vcl/source/glyphs/graphite_layout.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'vcl/source') 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(fExtraPerCluster * nCluster); int nCharIndex = mvGlyph2Char[i]; assert(nCharIndex > -1); - mvCharDxs[nCharIndex-mnMinCharPos] += nOffset; + if (static_cast(nCharIndex-mnMinCharPos) + < mvCharDxs.size()) + { + mvCharDxs[nCharIndex-mnMinCharPos] += nOffset; + } // adjust char dxs for rest of characters in cluster while (++nCharIndex - mnMinCharPos < static_cast(mvChar2BaseGlyph.size())) { -- cgit