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 Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/wmf/fail/hang-4.wmf differ diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index a379d8bd9bc4..9e446c06cfb3 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -650,7 +650,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++ )