diff options
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 23f81dffadc1..6fd9cf3f21c8 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1335,6 +1335,14 @@ Reference< XInputStream > SdrGrafObj::getInputStream() ::comphelper::LifecycleProxy proxy; xStream.set( pModel->GetDocumentStream(pGraphic->GetUserData(), proxy)); + // fdo#46340: this may look completely insane, and it is, + // but it also prevents a crash: the LifecycleProxy will go out + // of scope, but the xStream must be returned; the UcbStreamHelper + // will actually copy the xStream to a temp file (because it is + // not seekable), which makes it not crash... + SvStream *const pStream = + utl::UcbStreamHelper::CreateStream(xStream); + xStream.set(new utl::OInputStreamWrapper(pStream, true)); } else if( pGraphic && GetGraphic().IsLink() ) { |