summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_ap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfdoc/doc_ap.cpp')
-rw-r--r--core/src/fpdfdoc/doc_ap.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp
index d6c25f31e3..7fc9407c73 100644
--- a/core/src/fpdfdoc/doc_ap.cpp
+++ b/core/src/fpdfdoc/doc_ap.cpp
@@ -427,11 +427,8 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc,
pAnnotDict->SetAt("AP", pAPDict);
}
CPDF_Stream* pNormalStream = pAPDict->GetStream("N");
- if (pNormalStream == NULL) {
- pNormalStream = CPDF_Stream::Create(NULL, 0, NULL);
- if (pNormalStream == NULL) {
- return FALSE;
- }
+ if (!pNormalStream) {
+ pNormalStream = new CPDF_Stream(nullptr, 0, nullptr);
int32_t objnum = pDoc->AddIndirectObject(pNormalStream);
pAnnotDict->GetDict("AP")->SetAtReference("N", pDoc, objnum);
}