sw/source/core/doc/notxtfrm.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 76bc1304ffc937d8a38471119694b1d9d64d7070
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Sep 19 19:39:00 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Sep 20 10:33:47 2024 +0200

    null-deref seen on rtf2pdf with tdf94049-1.rtf
    
    Change-Id: I9cd64f5fb20ccea84446909414624314b7eb956b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173684
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit cb08fb797c58a4d21e7ae3a700b0e9ed30524a90)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173639
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 8afc1c60b280..b4ff11be973f 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1417,12 +1417,13 @@ void SwNoTextFrame::ImplPaintPictureBitmap( 
vcl::RenderContext* pOut,
     const Point aPosition(rAlignedGrfArea.Pos());
     const Size aSize(rAlignedGrfArea.SSize());
 
+    uno::Reference<embed::XEmbeddedObject> xObj = 
pOLENd->GetOLEObj().GetOleRef();
+
     if ( pGraphic && pGraphic->GetType() != GraphicType::NONE )
     {
         pGraphic->Draw(*pOut, aPosition, aSize);
 
         // shade the representation if the object is activated outplace
-        uno::Reference < embed::XEmbeddedObject > xObj = 
pOLENd->GetOLEObj().GetOleRef();
         if ( xObj.is() && xObj->getCurrentState() == 
embed::EmbedStates::ACTIVE )
         {
 
@@ -1441,7 +1442,7 @@ void SwNoTextFrame::ImplPaintPictureBitmap( 
vcl::RenderContext* pOut,
             pOut);
     }
 
-    sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( 
pOLENd->GetAspect() );
+    sal_Int64 nMiscStatus = xObj ? xObj->getStatus(pOLENd->GetAspect()) : 0;
     if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) !=  nullptr &&
             (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
     {

Reply via email to