summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-09-22 21:11:56 +0100
committerMichael Stahl <mstahl@redhat.com>2016-09-23 09:06:08 +0000
commita3218c2737fb3d78989e470991b1c712fc3a4275 (patch)
treeaf335e6630f9ef5a1c1fe87f46b967fc511f4edd /embeddedobj
parent8c581dd0c843e919ae4f0e91d5b114b6bb0699fe (diff)
Resolves: tdf#101971 OleLoad under structured exception guards
sample pptx crashes down in the depths of (apparently pre-installed on 32bit Windows 10) Flash.ocx Change-Id: I4e083d492e56e72df47b2c172d7f07f0e39b82ea Reviewed-on: https://gerrit.libreoffice.org/29199 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 373b44a2fcbe78e8a3ff14cd410826af151a6adf) Reviewed-on: https://gerrit.libreoffice.org/29212 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/msole/olecomponent.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index 6a7b9e471131..2f59f357ed58 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -715,6 +715,19 @@ sal_Bool OleComponent::InitializeObject_Impl()
return sal_True;
}
+namespace
+{
+ HRESULT OleLoadSeh(LPSTORAGE pIStorage, LPVOID* ppObj)
+ {
+ HRESULT hr = E_FAIL;
+ __try {
+ hr = OleLoad(pIStorage, IID_IUnknown, NULL, ppObj);
+ } __except( EXCEPTION_EXECUTE_HANDLER ) {
+ return E_FAIL;
+ }
+ return hr;
+ }
+}
void OleComponent::LoadEmbeddedObject( const OUString& aTempURL )
{
@@ -730,7 +743,7 @@ void OleComponent::LoadEmbeddedObject( const OUString& aTempURL )
if ( FAILED( hr ) || !m_pNativeImpl->m_pIStorage )
throw io::IOException(); // TODO: transport error code?
- hr = OleLoad( m_pNativeImpl->m_pIStorage, IID_IUnknown, NULL, (void**)&m_pNativeImpl->m_pObj );
+ hr = OleLoadSeh(m_pNativeImpl->m_pIStorage, (void**)&m_pNativeImpl->m_pObj);
if ( FAILED( hr ) || !m_pNativeImpl->m_pObj )
{
throw uno::RuntimeException();
@@ -963,7 +976,7 @@ void OleComponent::InitEmbeddedCopyOfLink( OleComponent* pOleLinkComponent )
{
hr = pObjectStorage->CopyTo( 0, NULL, NULL, m_pNativeImpl->m_pIStorage );
if ( SUCCEEDED( hr ) )
- hr = OleLoad( m_pNativeImpl->m_pIStorage, IID_IUnknown, NULL, (void**)&m_pNativeImpl->m_pObj );
+ hr = OleLoadSeh(m_pNativeImpl->m_pIStorage, (void**)&m_pNativeImpl->m_pObj);
}
}
}