summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-29 12:07:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-29 12:13:03 +0100
commit4fd693f718ac74115ea58208ac3427c01857d260 (patch)
tree04f5b1d98cc5b9a655b7cbd62a5a41845c58f1b8 /vcl
parentce3c818e8977561e6fbf11fe62997f29ae918521 (diff)
coverity#1325060 Argument cannot be negative bodge
Change-Id: Iee72d75a5609aa6e1098723ff62928bd47b42072
Diffstat (limited to 'vcl')
-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 305a5d4aa3b5..635417bba2db 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -739,6 +739,12 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
for (int n = i; n < nLastGlyph; n++)
mvGlyphs[n].maLinearPos.X() += (nDGlyphOrigin + nDWidth) * (bRtl ? -1 : 1);
+ if (nBaseGlyph < 0)
+ {
+ SAL_WARN( "vcl.gdi", "Negative BaseGlyph" );
+ continue;
+ }
+
rDeltaWidth[nBaseGlyph] = nDWidth;
#ifdef GRLAYOUT_DEBUG
fprintf(grLog(),"c%d=%d g%d-%d dW%ld-%ld=%ld dX%ld x%ld @%d=%d\n", firstChar, lastChar, i, nLastGlyph, nNewClusterWidth, nOrigClusterWidth, nDWidth, nDGlyphOrigin, mvGlyphs[i].maLinearPos.X(), mvCharDxs[lastChar - mnMinCharPos], args.mpDXArray[lastChar - args.mnMinCharPos]);