To avoid a NULL pointer de-reference, don't de-reference a null
pointer :-) I'd like to get this into 3.4.0
Thanks,
Michael.
--
michael.meeks@novell.com <><, Pseudo Engineer, itinerant idiot
From 5194f794f5162d1b27120c281a92f0ca7506b22d Mon Sep 17 00:00:00 2001
From: Michael Meeks <michael.meeks@novell.com>
Date: Thu, 19 May 2011 16:42:44 +0100
Subject: [PATCH] don't de-reference null pointer - fix crash with certain PPTX files
---
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 c18fd4a..cbae082 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 );
--
1.7.3.4
Context
- [Libreoffice] [REVIEW] trivial PPTX import crash fix · Michael Meeks
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.