--- a/src/lib/VSDContentCollector.cpp
+++ b/src/lib/VSDContentCollector.cpp
@@ -655,7 +655,8 @@ void libvisio::VSDContentCollector::_flushText()
       {
         // Insert duplicate
         std::vector<VSDCharStyle>::iterator charIt = m_charFormats.begin() + charIndex;
-        m_charFormats.insert(charIt, m_charFormats[charIndex]);
+        VSDCharStyle tmpCharFormat = m_charFormats[charIndex];
+        m_charFormats.insert(charIt, tmpCharFormat);
         m_charFormats[charIndex].charCount = paraCharCount;
         m_charFormats[charIndex+1].charCount -= paraCharCount;
       }
