diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-09-25 15:24:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-09-26 13:39:23 +0200 |
commit | 27fc6242c7153fcc3f41e38cc2ea649a3fe0c4cf (patch) | |
tree | f5e4a12924bdff45cb4412d6f2cd764bb271605d /basegfx | |
parent | cfc0fcd729e8e1e4395523a2ef2409fffc071f0d (diff) |
cid#1607525 silence Overflowed constant
and
cid#1607982 Overflowed constant
Change-Id: Ib7be7f8e17deb6184e25e543eab68dd704673eba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173968
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/polygon/b2dsvgpolypolygon.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx index 9728a3896de6..7e525d5e1644 100644 --- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx +++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx @@ -271,6 +271,7 @@ namespace basegfx::utils aCurrPoly.append(B2DPoint(nLastX, nLastY)); nCurrPolyCount = 1; } + assert(nCurrPolyCount > 0 && "coverity 2023.12.2"); // get first control point. It's the reflection of the PrevControlPoint // of the last point. If not existent, use current point (see SVG) @@ -416,15 +417,18 @@ namespace basegfx::utils } // ensure existence of start point - if(!aCurrPoly.count()) + sal_uInt32 nCurrPolyCount = aCurrPoly.count(); + if (nCurrPolyCount == 0) { aCurrPoly.append(B2DPoint(nLastX, nLastY)); + nCurrPolyCount = 1; } + assert(nCurrPolyCount > 0 && "coverity 2023.12.2"); // get first control point. It's the reflection of the PrevControlPoint // of the last point. If not existent, use current point (see SVG) B2DPoint aPrevControl(nLastX, nLastY); - const sal_uInt32 nIndex(aCurrPoly.count() - 1); + const sal_uInt32 nIndex(nCurrPolyCount - 1); const B2DPoint aPrevPoint(aCurrPoly.getB2DPoint(nIndex)); if(aCurrPoly.areControlPointsUsed() && aCurrPoly.isPrevControlPointUsed(nIndex)) |