summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-16 17:00:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-16 17:00:40 +0000
commitdd70861fd7123c826feefa86f8af1da1f4877c97 (patch)
tree33078a663310884c44da6f05cd9b870c8add88ac /filter
parent1e3879f7be9384e6c1027f2ac148ddf0754b6b54 (diff)
ofz: ensure nOldSize is > 0
Change-Id: Iaf385c9cd4fd37d56879908c00c7483762d66a0b
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 6d6067cd44e4..7a9d624088ed 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -556,7 +556,7 @@ void OS2METReader::AddPointsToArea(const tools::Polygon & rPoly)
else {
tools::Polygon aLastPoly(pPP->GetObject(pPP->Count()-1));
nOldSize=aLastPoly.GetSize();
- if (aLastPoly.GetPoint(nOldSize-1)==rPoly.GetPoint(0)) nOldSize--;
+ if (nOldSize && aLastPoly.GetPoint(nOldSize-1)==rPoly.GetPoint(0)) nOldSize--;
nNewSize=nOldSize+rPoly.GetSize();
aLastPoly.SetSize(nNewSize);
for (i=nOldSize; i<nNewSize; i++) {
@@ -577,7 +577,7 @@ void OS2METReader::AddPointsToPath(const tools::Polygon & rPoly)
else {
tools::Polygon aLastPoly(pPP->GetObject(pPP->Count()-1));
nOldSize=aLastPoly.GetSize();
- if (aLastPoly.GetPoint(nOldSize-1)!=rPoly.GetPoint(0)) pPP->Insert(rPoly);
+ if (nOldSize && aLastPoly.GetPoint(nOldSize-1)!=rPoly.GetPoint(0)) pPP->Insert(rPoly);
else {
nOldSize--;
nNewSize=nOldSize+rPoly.GetSize();