summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_shadingpattern.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page/cpdf_shadingpattern.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_shadingpattern.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/fpdfapi/page/cpdf_shadingpattern.cpp b/core/fpdfapi/page/cpdf_shadingpattern.cpp
index e19ffaf0c4..133d32ff3a 100644
--- a/core/fpdfapi/page/cpdf_shadingpattern.cpp
+++ b/core/fpdfapi/page/cpdf_shadingpattern.cpp
@@ -50,8 +50,11 @@ CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc,
CPDF_ShadingPattern::~CPDF_ShadingPattern() {
CPDF_ColorSpace* pCS = m_pCountedCS ? m_pCountedCS->get() : nullptr;
- if (pCS && m_pDocument)
- m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
+ if (pCS && m_pDocument) {
+ auto* pPageData = m_pDocument->GetPageData();
+ if (pPageData)
+ pPageData->ReleaseColorSpace(pCS->GetArray());
+ }
}
CPDF_TilingPattern* CPDF_ShadingPattern::AsTilingPattern() {