diff options
author | Michael Meeks <michael.meeks@novell.com> | 2011-05-19 16:42:44 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-05-19 16:43:30 +0100 |
commit | 3cc072ce7a6ecd4856cc63276fda069952a26034 (patch) | |
tree | ac44235db005a8c4807aaf567c25d4be457affad /oox | |
parent | accf94cab8fdddb251d1d95a05a79e3219ccbc3b (diff) |
don't de-reference null pointer - fix crash with certain PPTX files
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/ppt/presentationfragmenthandler.cxx | 12 |
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 ); |