summaryrefslogtreecommitdiffstats
path: root/oox
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-05-19 16:42:44 +0100
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-05-20 11:07:26 +0200
commit149c5f59f49032f98a4ceaff11144dbf1cdc59df (patch)
treead30c4d14c7f54a3bc8505d03ad9e25c2711b77e /oox
parentfix config for pptx filter - thanks to Bubli (diff)
downloadcore-149c5f59f49032f98a4ceaff11144dbf1cdc59df.tar.gz
core-149c5f59f49032f98a4ceaff11144dbf1cdc59df.zip
don't de-reference null pointer - fix crash with certain PPTX files
Signed-off-by: Jan Holesovsky <kendy@suse.cz> Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 006cdab9792e..31a2781d845b 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -246,11 +246,13 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
}
// importing slide page
- pSlidePersistPtr->setMasterPersist( pMasterPersistPtr );
- pSlidePersistPtr->setTheme( pMasterPersistPtr->getTheme() );
- Reference< drawing::XMasterPageTarget > xMasterPageTarget( pSlidePersistPtr->getPage(), UNO_QUERY );
- if( xMasterPageTarget.is() )
- xMasterPageTarget->setMasterPage( pMasterPersistPtr->getPage() );
+ if (pMasterPersistPtr.get()) {
+ pSlidePersistPtr->setMasterPersist( pMasterPersistPtr );
+ pSlidePersistPtr->setTheme( pMasterPersistPtr->getTheme() );
+ Reference< drawing::XMasterPageTarget > xMasterPageTarget( pSlidePersistPtr->getPage(), UNO_QUERY );
+ if( xMasterPageTarget.is() )
+ xMasterPageTarget->setMasterPage( pMasterPersistPtr->getPage() );
+ }
rFilter.getDrawPages().push_back( pSlidePersistPtr );
rFilter.setActualSlidePersist( pSlidePersistPtr );
importSlide( xSlideFragmentHandler, pSlidePersistPtr );