summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-24 11:36:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-24 11:38:33 +0000
commitb1a1bdec2d667225ae4c8137c447f9080bafbe5c (patch)
tree47cbfd2660bac0036f1550a0e5e3a82d39eae342 /vcl
parentc7cf94f70f4673b1f6933dbd28cbd89ab459fc45 (diff)
ofz: slow unit
Change-Id: I482a6c95810d03e47a5be18e6b45ee4db19f56e4
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/graphicfilter/data/wmf/pass/exttextout-1.wmfbin0 -> 2142 bytes
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx8
2 files changed, 8 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/data/wmf/pass/exttextout-1.wmf b/vcl/qa/cppunit/graphicfilter/data/wmf/pass/exttextout-1.wmf
new file mode 100644
index 000000000000..365a247a7103
--- /dev/null
+++ b/vcl/qa/cppunit/graphicfilter/data/wmf/pass/exttextout-1.wmf
Binary files differ
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 810aa106ccd0..5ee86b972f9e 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -545,6 +545,14 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
const Point aPt2( ReadPoint() );
aRect = Rectangle( aPt1, aPt2 );
}
+
+ auto nRemainingSize = pWMF->remainingSize();
+ if (nRemainingSize < static_cast<sal_uInt32>(nOriginalBlockLen))
+ {
+ SAL_WARN("vcl.wmf", "exttextout record claimed more data than the stream can provide");
+ nOriginalTextLen = nOriginalBlockLen = nRemainingSize;
+ }
+
std::unique_ptr<char[]> pChar(new char[nOriginalBlockLen]);
pWMF->ReadBytes(pChar.get(), nOriginalBlockLen);
OUString aText(pChar.get(), nOriginalTextLen, pOut->GetCharSet()); // after this conversion the text may contain