Kaydet (Commit) 23c16ec4 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

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.
üst 7b7c3b6e
...@@ -84,6 +84,7 @@ public: ...@@ -84,6 +84,7 @@ public:
{ {
// add nCount copies of rPolygon // add nCount copies of rPolygon
PolygonVector::iterator aIndex(maPolygons.begin()); PolygonVector::iterator aIndex(maPolygons.begin());
if( nIndex )
aIndex += nIndex; aIndex += nIndex;
maPolygons.insert(aIndex, nCount, rPolygon); maPolygons.insert(aIndex, nCount, rPolygon);
} }
...@@ -93,6 +94,7 @@ public: ...@@ -93,6 +94,7 @@ public:
{ {
// add all polygons from rPolyPolygon // add all polygons from rPolyPolygon
PolygonVector::iterator aIndex(maPolygons.begin()); PolygonVector::iterator aIndex(maPolygons.begin());
if( nIndex )
aIndex += nIndex; aIndex += nIndex;
maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end()); maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end());
} }
......
...@@ -83,6 +83,7 @@ public: ...@@ -83,6 +83,7 @@ public:
{ {
// add nCount copies of rPolygon // add nCount copies of rPolygon
PolygonVector::iterator aIndex(maPolygons.begin()); PolygonVector::iterator aIndex(maPolygons.begin());
if( nIndex )
aIndex += nIndex; aIndex += nIndex;
maPolygons.insert(aIndex, nCount, rPolygon); maPolygons.insert(aIndex, nCount, rPolygon);
} }
...@@ -92,6 +93,7 @@ public: ...@@ -92,6 +93,7 @@ public:
{ {
// add all polygons from rPolyPolygon // add all polygons from rPolyPolygon
PolygonVector::iterator aIndex(maPolygons.begin()); PolygonVector::iterator aIndex(maPolygons.begin());
if( nIndex )
aIndex += nIndex; aIndex += nIndex;
maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end()); maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment