summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2013-05-12 11:27:14 +0200
committerDavid Tardon <dtardon@redhat.com>2013-05-12 11:27:14 +0200
commit62a1abdadcba61f9a0d0daf38c442f0cd86c8718 (patch)
tree51cc1d29d5df4ae241cba3a2b5fd52228bd81105
parentc5780bf9208736870ebfd0e1177b769a15f3f7e0 (diff)
avoid access to uninit. memory
-rw-r--r--src/lib/VSDParser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp
index 9fdb8be..1b65ac8 100644
--- a/src/lib/VSDParser.cpp
+++ b/src/lib/VSDParser.cpp
@@ -845,8 +845,12 @@ void libvisio::VSDParser::readTextBlock(WPXInputStream *input)
void libvisio::VSDParser::readGeomList(WPXInputStream *input)
{
if (!m_shape.m_geometries.empty() && m_currentGeometryList->empty())
+ {
m_shape.m_geometries.erase(--m_currentGeomListCount);
- m_currentGeometryList = &m_shape.m_geometries[m_currentGeomListCount++];
+ m_currentGeometryList = 0;
+ }
+ if (!m_shape.m_geometries.empty()) // broken file?
+ m_currentGeometryList = &m_shape.m_geometries[m_currentGeomListCount++];
if (m_header.trailer)
{