[Libreoffice-commits] core.git: filter/qa filter/source

Caolán McNamara caolanm at redhat.com
Thu Jul 16 02:25:54 PDT 2015


 filter/qa/cppunit/data/pict/fail/exception-1.pct |binary
 filter/source/graphicfilter/ipict/ipict.cxx      |    5 +++++
 2 files changed, 5 insertions(+)

New commits:
commit cf4159e16c13a13d0bedccebb50bb08f1662bc1c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jul 16 10:01:24 2015 +0100

    exception on div by 0
    
    Change-Id: Id33d6a5e3df5812babd28ebfc65b95ce97219ad3

diff --git a/filter/qa/cppunit/data/pict/fail/exception-1.pct b/filter/qa/cppunit/data/pict/fail/exception-1.pct
new file mode 100644
index 0000000..f9cd85a
Binary files /dev/null and b/filter/qa/cppunit/data/pict/fail/exception-1.pct differ
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index e6b7fd0..0c1960b 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -1859,6 +1859,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode)
 
 void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
 {
+    try {
     sal_uInt16          nOpcode;
     sal_uInt8           nOneByteOpcode;
     sal_uLong           nSize, nPercent, nLastPercent;
@@ -1950,6 +1951,10 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
     pPict->SetEndian(nOrigNumberFormat);
 
     if (pPict->GetError()) pPict->Seek(nOrigPos);
+    } catch (...)
+    {
+        rStreamPict.SetError(SVSTREAM_FILEFORMAT_ERROR);
+    }
 }
 
 namespace pict {


More information about the Libreoffice-commits mailing list