summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2012-06-16 15:17:04 +0200
committerJulien Nabet <serval2412@yahoo.fr>2012-06-16 15:17:04 +0200
commitfec099556e1aa6e9d4177908530900dd02e17136 (patch)
treef4fb14529c55ebb3ce85eb7b23625947450bc164
parent6bd252598ca662b909afefb133c63a4f7f4b6e84 (diff)
Related: fdo#48601 FILEOPEN: Open Visio's file with bitmap's blocks
This fdo contains 2 files with which I had a different crash for each of them. This patch fixes one of the 2 crashes.
-rw-r--r--src/lib/VSDXContentCollector.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp
index cfbd9be..4fc0e48 100644
--- a/src/lib/VSDXContentCollector.cpp
+++ b/src/lib/VSDXContentCollector.cpp
@@ -1131,14 +1131,17 @@ void libvisio::VSDXContentCollector::collectInfiniteLine(unsigned /* id */, unsi
if (x <= m_pageWidth && x >= 0)
points[x] = y;
- xmove = points.begin()->first;
- ymove = points.begin()->second;
- for (std::map<double, double>::iterator iter = points.begin(); iter != points.end(); ++iter)
+ if (!points.empty())
{
- if (iter->first != xmove || iter->second != ymove)
+ xmove = points.begin()->first;
+ ymove = points.begin()->second;
+ for (std::map<double, double>::iterator iter = points.begin(); iter != points.end(); ++iter)
{
- xline = iter->first;
- yline = iter->second;
+ if (iter->first != xmove || iter->second != ymove)
+ {
+ xline = iter->first;
+ yline = iter->second;
+ }
}
}
}