summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2011-12-13 20:56:17 +0100
committerThorsten Behrens <tbehrens@suse.com>2011-12-13 20:58:39 +0100
commit23c16ec47cec92566b426168ed53c795116b56f6 (patch)
tree507133d301f2bdb141f2324f722f8a024a775f07 /basegfx
parent7b7c3b6e1102e7f8856f047fe475ddbc53438f4e (diff)
Fix abort from stl debug iterators' invalid access.
Triggered by fdo#43725, incrementing an invalid iterator bombs - though this seems a corner case, depends on whether one considers "+= 0" as incrementing or not.
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b2dpolypolygon.cxx6
-rw-r--r--basegfx/source/polygon/b3dpolypolygon.cxx6
2 files changed, 8 insertions, 4 deletions
diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx
index bdd619fb0033..3ec0ed824347 100644
--- a/basegfx/source/polygon/b2dpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dpolypolygon.cxx
@@ -84,7 +84,8 @@ public:
{
// add nCount copies of rPolygon
PolygonVector::iterator aIndex(maPolygons.begin());
- aIndex += nIndex;
+ if( nIndex )
+ aIndex += nIndex;
maPolygons.insert(aIndex, nCount, rPolygon);
}
}
@@ -93,7 +94,8 @@ public:
{
// add all polygons from rPolyPolygon
PolygonVector::iterator aIndex(maPolygons.begin());
- aIndex += nIndex;
+ if( nIndex )
+ aIndex += nIndex;
maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end());
}
diff --git a/basegfx/source/polygon/b3dpolypolygon.cxx b/basegfx/source/polygon/b3dpolypolygon.cxx
index cbd59b6ac362..be1db5e98efb 100644
--- a/basegfx/source/polygon/b3dpolypolygon.cxx
+++ b/basegfx/source/polygon/b3dpolypolygon.cxx
@@ -83,7 +83,8 @@ public:
{
// add nCount copies of rPolygon
PolygonVector::iterator aIndex(maPolygons.begin());
- aIndex += nIndex;
+ if( nIndex )
+ aIndex += nIndex;
maPolygons.insert(aIndex, nCount, rPolygon);
}
}
@@ -92,7 +93,8 @@ public:
{
// add all polygons from rPolyPolygon
PolygonVector::iterator aIndex(maPolygons.begin());
- aIndex += nIndex;
+ if( nIndex )
+ aIndex += nIndex;
maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end());
}