| commit | 8c0f424a131dbb2e5f82ec27362d5c3cbfc4b92d | [log] |
|---|---|---|
| author | nd101 <Fong@nd.com.cn> | Wed Mar 25 13:43:32 2020 +0800 |
| committer | Michael Stahl <michael.stahl@cib.de> | Fri Mar 27 10:57:16 2020 +0100 |
| tree | 3175d6e2d5298c3b0dc3f82a902221c9b6c87a8c | |
| parent | 9e22575c8383fc26d94c6bc5407d9b7f08b9ee87 [diff] |
tdf#131553 a null pointer crashes Impress When constructing a shape object from property EmbeddedObject, it may return null object. Check the returned value first. Change-Id: I9d7a2d9c0c919007ae2a34a0af86dea5639b1bd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91024 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit df1be683ab935fe5362750360508ba69eb415afb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90959 Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org> (cherry picked from commit 3142872bcba19b6c4d60b464fc9b14293860348d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90962 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index e061902..6336bd0 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx
@@ -936,11 +936,14 @@ Reference< XShape > const & Shape::createAndInsert( xSet->setPropertyValue("CLSID", uno::makeAny(name.GetHexName())); uno::Reference<embed::XEmbeddedObject> const xObj( xSet->getPropertyValue("EmbeddedObject"), uno::UNO_QUERY); uno::Reference<uno::XInterface> const xMathModel(xObj->getComponent()); oox::FormulaImportBase *const pMagic( dynamic_cast<oox::FormulaImportBase*>(xMathModel.get())); assert(pMagic); pMagic->readFormulaOoxml(*pMathXml); if (xObj.is()) { uno::Reference<uno::XInterface> const xMathModel(xObj->getComponent()); oox::FormulaImportBase *const pMagic( dynamic_cast<oox::FormulaImportBase*>(xMathModel.get())); assert(pMagic); pMagic->readFormulaOoxml(*pMathXml); } } const GraphicHelper& rGraphicHelper = rFilterBase.getGraphicHelper();