summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-06-06 16:12:10 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-07 00:58:34 +0000
commitd9d6c29879780db829694d0023a377581bbc9769 (patch)
treef1c3b279e183ef709c132780df7187f65c3d246e /core/fpdfapi/edit
parent7dee685df0309401ad37c30c49a56d8523d1f8bb (diff)
downloadpdfium-d9d6c29879780db829694d0023a377581bbc9769.tar.xz
Fix EmptyCreation test
The Contents stream of a page is optional per PDF spec 1.7 Table 3.27. This CL fixes the empty creation test to acknowledge that. Change-Id: I1e59a1fedbf00eafabe87962830d62d8883a5e1f Reviewed-on: https://pdfium-review.googlesource.com/6311 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
index 7abf7a4964..2f00c7db09 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
@@ -62,10 +62,9 @@ CPDF_PageContentGenerator::~CPDF_PageContentGenerator() {}
void CPDF_PageContentGenerator::GenerateContent() {
CPDF_Document* pDoc = m_pDocument.Get();
CFX_ByteTextBuf buf;
- if (!m_pageObjects.empty()) {
- if (!ProcessPageObjects(&buf))
- return;
- }
+ if (!ProcessPageObjects(&buf))
+ return;
+
CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict.Get();
CPDF_Object* pContent =
pPageDict ? pPageDict->GetObjectFor("Contents") : nullptr;