summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-08-31 15:06:27 +0100
committerAndras Timar <andras.timar@collabora.com>2015-09-04 17:11:16 +0200
commitc0b828d4fa6a80d3a4ace485f95477a9bc6b4a39 (patch)
tree6c545790cd303540a0e23ce51d1425d851bd44eb
parent0d5a671b4c848f077b03c21a3159f3a30495b432 (diff)
check stream status
Change-Id: I27bb289288d319a93201e9c3d703114924ca258c (cherry picked from commit daf1578d752531e2b48d183531d9a4a7cedfc37e) Reviewed-on: https://gerrit.libreoffice.org/18178 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--vcl/qa/cppunit/graphicfilter/data/wmf/fail/hang-4.wmfbin0 -> 244 bytes
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx2
2 files changed, 1 insertions, 1 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/data/wmf/fail/hang-4.wmf b/vcl/qa/cppunit/graphicfilter/data/wmf/fail/hang-4.wmf
new file mode 100644
index 000000000000..f16b60ca7f82
--- /dev/null
+++ b/vcl/qa/cppunit/graphicfilter/data/wmf/fail/hang-4.wmf
Binary files differ
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 4667844ff6c3..0a5fd12d7e36 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -627,7 +627,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
pAcc = aBmp.AcquireWriteAccess();
if ( pAcc )
{
- for (sal_uInt16 y = 0; y < nHeight; y++ )
+ for (sal_uInt16 y = 0; y < nHeight && pWMF->good(); ++y)
{
sal_uInt16 x = 0;
for (sal_uInt16 scan = 0; scan < nBytesPerScan; scan++ )