diff options
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/fpdf_page/cpdf_colorspace.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_page/fpdf_page_doc.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_array.h | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp index 9d3aeb2adc..759d0f37b5 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp @@ -355,7 +355,7 @@ CPDF_ColorSpace* CPDF_ColorSpace::Load(CPDF_Document* pDoc, CPDF_Object* pObj) { } CPDF_Array* pArray = pObj->AsArray(); - if (!pArray || pArray->GetCount() == 0) + if (!pArray || pArray->IsEmpty()) return nullptr; CPDF_Object* pFamilyObj = pArray->GetDirectObjectAt(0); diff --git a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp index 059679a8cd..f8d7575318 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp @@ -275,7 +275,7 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpaceImpl( } CPDF_Array* pArray = pCSObj->AsArray(); - if (!pArray || pArray->GetCount() == 0) + if (!pArray || pArray->IsEmpty()) return nullptr; if (pArray->GetCount() == 1) { diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_array.h b/core/fpdfapi/fpdf_parser/include/cpdf_array.h index 0629046d9e..9bb99da053 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_array.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_array.h @@ -28,6 +28,7 @@ class CPDF_Array : public CPDF_Object { CPDF_Array* AsArray() override; const CPDF_Array* AsArray() const override; + bool IsEmpty() const { return m_Objects.empty(); } size_t GetCount() const { return m_Objects.size(); } CPDF_Object* GetObjectAt(size_t index) const; CPDF_Object* GetDirectObjectAt(size_t index) const; |