summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_editpage.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-07-05 16:55:48 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-05 16:55:48 +0000
commit6c4ca9f597ae84550e0b8a4323e44b188f9bb274 (patch)
tree6f1cb0f180279e943d5e6ed463bfb17edf154bd8 /fpdfsdk/fpdf_editpage.cpp
parent3fab31fb8e35eca693322ac292228e993b508102 (diff)
downloadpdfium-6c4ca9f597ae84550e0b8a4323e44b188f9bb274.tar.xz
Delete CPDF_ContentMark::HasRef()
This is called by many client to make sure CountItems() does not crash. Moving the check to CountItems() makes HasRef() unnecessary. Bug: pdfium:1037 Change-Id: I4f21f33a88c9aad54f0dae18a38b370c6ceaec80 Reviewed-on: https://pdfium-review.googlesource.com/37133 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_editpage.cpp')
-rw-r--r--fpdfsdk/fpdf_editpage.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index 36853c70c6..d21b215d09 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -277,7 +277,7 @@ FPDFPageObj_CountMarks(FPDF_PAGEOBJECT page_object) {
const auto& mark =
CPDFPageObjectFromFPDFPageObject(page_object)->m_ContentMark;
- return mark.HasRef() ? mark.CountItems() : 0;
+ return mark.CountItems();
}
FPDF_EXPORT FPDF_PAGEOBJECTMARK FPDF_CALLCONV
@@ -286,9 +286,6 @@ FPDFPageObj_GetMark(FPDF_PAGEOBJECT page_object, unsigned long index) {
return nullptr;
auto* mark = &CPDFPageObjectFromFPDFPageObject(page_object)->m_ContentMark;
- if (!mark->HasRef())
- return nullptr;
-
if (index >= mark->CountItems())
return nullptr;