summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index efa0a0bce0b5..9725bcc8b998 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -77,12 +77,17 @@ bool SdPdfFilter::Import()
// Create the page and insert the Graphic.
SdPage* pPage = mrDocument.GetSdPage(nPageNumber, PageKind::Standard);
+ if (!pPage) // failed to duplicate page, out of memory?
+ return false;
// Make the page size match the rendered image.
pPage->SetSize(aSizeHMM);
SdrGrafObj* pSdrGrafObj = new SdrGrafObj(pPage->getSdrModelFromSdrPage(), rGraphic,
tools::Rectangle(Point(), aSizeHMM));
+ if (!pSdrGrafObj) // out of memory
+ return false;
+
pSdrGrafObj->SetResizeProtect(true);
pSdrGrafObj->SetMoveProtect(true);