summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_docpagedata.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/core/fpdfapi/page/cpdf_docpagedata.cpp b/core/fpdfapi/page/cpdf_docpagedata.cpp
index dc2554f92d..0d2a9189b6 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.cpp
+++ b/core/fpdfapi/page/cpdf_docpagedata.cpp
@@ -346,19 +346,20 @@ CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj,
m_pPDFDoc.Get(), pPatternObj, true, matrix);
} else {
CPDF_Dictionary* pDict = pPatternObj->GetDict();
- if (pDict) {
- int type = pDict->GetIntegerFor("PatternType");
- if (type == CPDF_Pattern::TILING) {
- pPattern = pdfium::MakeUnique<CPDF_TilingPattern>(m_pPDFDoc.Get(),
- pPatternObj, matrix);
- } else if (type == CPDF_Pattern::SHADING) {
- pPattern = pdfium::MakeUnique<CPDF_ShadingPattern>(
- m_pPDFDoc.Get(), pPatternObj, false, matrix);
- }
+ if (!pDict)
+ return nullptr;
+
+ int type = pDict->GetIntegerFor("PatternType");
+ if (type == CPDF_Pattern::TILING) {
+ pPattern = pdfium::MakeUnique<CPDF_TilingPattern>(m_pPDFDoc.Get(),
+ pPatternObj, matrix);
+ } else if (type == CPDF_Pattern::SHADING) {
+ pPattern = pdfium::MakeUnique<CPDF_ShadingPattern>(
+ m_pPDFDoc.Get(), pPatternObj, false, matrix);
+ } else {
+ return nullptr;
}
}
- if (!pPattern)
- return nullptr;
if (ptData) {
ptData->reset(std::move(pPattern));