From d62dddd6345e8f1730eed1bb2b7183499a85133f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 29 Sep 2015 12:09:33 +0100 Subject: coverity#1325059 Argument cannot be negative bodge Change-Id: I9bae22c7420247a26f0fe73e6c4e590471f19b0e --- vcl/source/glyphs/graphite_layout.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vcl/source/glyphs/graphite_layout.cxx') diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 635417bba2db..10be4a0f3c20 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -689,6 +689,12 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector & rDelt for (int i = startGi; i < endGi; ++i) { + if (i < 0) + { + SAL_WARN( "vcl.gdi", "Negative index" ); + continue; + } + // calculate visual cluster bounds int firstChar = mvGlyph2Char[i]; int nBaseGlyph = mvChar2BaseGlyph[firstChar - mnMinCharPos]; -- cgit v1.2.3