From b6589ad8c7a5aed5ae13cf8bf8482ceba19a2067 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 25 Jun 2023 19:58:11 +0100 Subject: ofz: Use-of-uninitialized-value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia064835f3fee71e9a177b2ab37f66e3fd2a94fce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153569 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sd/source/filter/ppt/pptin.cxx | 63 +++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 31 deletions(-) (limited to 'sd/source') diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 53d28a3c46ea..3eaebfd1892b 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2686,44 +2686,45 @@ rtl::Reference ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData if ( SeekToRec( rSt, PPT_PST_InteractiveInfoAtom, nHdRecEnd, &aHdInteractiveInfoAtom ) ) { PptInteractiveInfoAtom aInteractiveInfoAtom; - ReadPptInteractiveInfoAtom( rSt, aInteractiveInfoAtom ); - - // interactive object - SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj, true); - - FillSdAnimationInfo(pInfo, aInteractiveInfoAtom, aMacroName); - if ( aInteractiveInfoAtom.nAction == 6 ) // Sj -> media action + if (ReadPptInteractiveInfoAtom(rSt, aInteractiveInfoAtom)) { - rHdClientData.SeekToContent( rStCtrl ); - DffRecordHeader aObjRefAtomHd; - if ( SeekToRec( rSt, PPT_PST_ExObjRefAtom, nHdRecEnd, &aObjRefAtomHd ) ) + // interactive object + SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj, true); + + FillSdAnimationInfo(pInfo, aInteractiveInfoAtom, aMacroName); + if ( aInteractiveInfoAtom.nAction == 6 ) // Sj -> media action { - sal_uInt32 nRef; - rSt.ReadUInt32( nRef ); - OUString aMediaURL( ReadMedia( nRef ) ); - if ( aMediaURL.isEmpty() ) - aMediaURL = ReadSound( nRef ); - if ( !aMediaURL.isEmpty() ) + rHdClientData.SeekToContent( rStCtrl ); + DffRecordHeader aObjRefAtomHd; + if ( SeekToRec( rSt, PPT_PST_ExObjRefAtom, nHdRecEnd, &aObjRefAtomHd ) ) { - rtl::Reference pMediaObj = new SdrMediaObj( - pObj->getSdrModelFromSdrObject(), - pObj->GetSnapRect()); - pMediaObj->SetMergedItemSet( pObj->GetMergedItemSet() ); - - //--remove object from maAnimations list and add the new object instead - Ppt97AnimationPtr pAnimation; + sal_uInt32 nRef; + rSt.ReadUInt32( nRef ); + OUString aMediaURL( ReadMedia( nRef ) ); + if ( aMediaURL.isEmpty() ) + aMediaURL = ReadSound( nRef ); + if ( !aMediaURL.isEmpty() ) { - tAnimationMap::iterator aFound = maAnimations.find( pObj.get() ); - if( aFound != maAnimations.end() ) + rtl::Reference pMediaObj = new SdrMediaObj( + pObj->getSdrModelFromSdrObject(), + pObj->GetSnapRect()); + pMediaObj->SetMergedItemSet( pObj->GetMergedItemSet() ); + + //--remove object from maAnimations list and add the new object instead + Ppt97AnimationPtr pAnimation; { - pAnimation = (*aFound).second; - maAnimations.erase(aFound); + tAnimationMap::iterator aFound = maAnimations.find( pObj.get() ); + if( aFound != maAnimations.end() ) + { + pAnimation = (*aFound).second; + maAnimations.erase(aFound); + } + maAnimations[pMediaObj.get()] = pAnimation; } - maAnimations[pMediaObj.get()] = pAnimation; - } - pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list - pMediaObj->setURL( aMediaURL, ""/*TODO?*/ ); + pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list + pMediaObj->setURL( aMediaURL, ""/*TODO?*/ ); + } } } } -- cgit