summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-29 12:09:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-29 12:13:03 +0100
commitd62dddd6345e8f1730eed1bb2b7183499a85133f (patch)
treece719d6210b13d4da78029fa1b991ca6d8fc7578
parent4fd693f718ac74115ea58208ac3427c01857d260 (diff)
coverity#1325059 Argument cannot be negative bodge
Change-Id: I9bae22c7420247a26f0fe73e6c4e590471f19b0e
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx6
1 files changed, 6 insertions, 0 deletions
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<int> & 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];