From 30541352a195c57c0b4f65e29b1994be46421ad1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 20 Aug 2014 09:49:46 +0100 Subject: fix string out-of-bounds assert on rhbz496762-1.pdf Change-Id: I224e3c9befd1a9ab3ba0cc2676cd6b4ba51214c8 --- sdext/source/pdfimport/wrapper/wrapper.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index 7cdb775b256b..eedffe48ba03 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -374,7 +374,10 @@ void Parser::readChar() readDouble(aUnoMatrix.m11); readDouble(fontSize); - OString aChars = lcl_unescapeLineFeeds( m_aLine.copy( m_nCharIndex ) ); + OString aChars; + + if (m_nCharIndex != -1) + aChars = lcl_unescapeLineFeeds( m_aLine.copy( m_nCharIndex ) ); // chars gobble up rest of line m_nCharIndex = -1; -- cgit