summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2012-05-31 15:16:43 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-05-31 15:16:43 +0200
commit870bd8035177446209d70efb8c3272c9c9a56491 (patch)
treeac5978f357e34500a334e88eaab79777426b80ba
parent8d2d1c8c5b9a85b841843c51e546d7f121b414ec (diff)
Resolves: fdo#50178 Reading Visio file causes crash
Problem with iterators, more info here : http://nabble.documentfoundation.org/PATCH-fix-proposed-for-fdo-50178-Visio-td3985678.html
-rw-r--r--src/lib/VSDXContentCollector.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp
index ac5d579..ec25fb4 100644
--- a/src/lib/VSDXContentCollector.cpp
+++ b/src/lib/VSDXContentCollector.cpp
@@ -1515,6 +1515,7 @@ double libvisio::VSDXContentCollector::_NURBSBasis(unsigned knot, unsigned degre
void libvisio::VSDXContentCollector::collectNURBSTo(unsigned id, unsigned level, double x2, double y2, double knot, double knotPrev, double weight, double weightPrev, unsigned dataID)
{
std::map<unsigned, NURBSData>::const_iterator iter;
+ std::map<unsigned, NURBSData>::const_iterator iterEnd;
NURBSData data;
if (dataID == 0xFFFFFFFE) // Use stencil NURBS data
{
@@ -1534,13 +1535,15 @@ void libvisio::VSDXContentCollector::collectNURBSTo(unsigned id, unsigned level,
}
dataID = tmpElement->m_dataID;
iter = m_stencilShape->m_nurbsData.find(dataID);
+ iterEnd = m_stencilShape->m_nurbsData.end();
}
else // No stencils involved, directly get dataID and fill in missing parts
{
iter = m_NURBSData.find(dataID);
+ iterEnd = m_NURBSData.end();
}
- if (iter != m_NURBSData.end())
+ if (iter != iterEnd)
{
data = iter->second;
data.knots.push_back(knot);