diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-22 17:23:14 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-22 21:03:50 +0000 |
commit | be630d7bd9298c1447983af99959aa7de2d6e2a1 (patch) | |
tree | ee933cce04f77f5d9aa64c6e15f5ffc71ba04804 /sd | |
parent | cb2a1cb37035a634a3e30bd81480ca311bf11eba (diff) |
catch structured storage exceptions during testing
Change-Id: Ibce297f85ebcf5ebde1a9e81afef9b0c41ebeb1a
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 4e3ca127c265..3b2589384909 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2759,9 +2759,17 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL ImportPPT( extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportPPT(SvStream &rStream) { - tools::SvRef<SotStorage> xStorage(new SotStorage(rStream)); - if (xStorage->GetError()) + tools::SvRef<SotStorage> xStorage; + try + { + xStorage = tools::SvRef<SotStorage>(new SotStorage(rStream)); + if (xStorage->GetError()) + return false; + } + catch (...) + { return false; + } tools::SvRef<SotStorageStream> xDocStream(xStorage->OpenSotStream( "PowerPoint Document", StreamMode::STD_READ)); if ( !xDocStream.is() ) |