diff options
author | tsepez <tsepez@chromium.org> | 2016-11-14 15:03:55 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-14 15:03:55 -0800 |
commit | 137a344ad02056107e2e01d5d55f5e97d21fa74b (patch) | |
tree | 25bb148e669379d6f7f0d2d737d532db10ce9380 /core/fpdfapi/parser | |
parent | 88d87c13c25fbd20fd2963e8ff4b383c5d64b5f4 (diff) | |
download | pdfium-137a344ad02056107e2e01d5d55f5e97d21fa74b.tar.xz |
Make CPDF_PageContentGenerator methods take object numbers
This patch fixes a possibility that an owned CPDF_Stream is handed to the
indirect object holder inside RealizeResource(). Its arguments are
changed to take an object number, as is done elsewhere in the code, to
suggest that only indirect objects are acceptable.
BUG=660756
Review-Url: https://codereview.chromium.org/2489423002
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.cpp | 9 | ||||
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.h | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp index 6788394118..ebd3156e35 100644 --- a/core/fpdfapi/parser/cpdf_document.cpp +++ b/core/fpdfapi/parser/cpdf_document.cpp @@ -641,12 +641,9 @@ CPDF_IccProfile* CPDF_Document::LoadIccProfile(CPDF_Stream* pStream) { return m_pDocPage->GetIccProfile(pStream); } -CPDF_Image* CPDF_Document::LoadImageF(CPDF_Object* pObj) { - if (!pObj) - return nullptr; - - ASSERT(pObj->GetObjNum()); - return m_pDocPage->GetImage(pObj); +CPDF_Image* CPDF_Document::LoadImageFromPageData(uint32_t dwStreamObjNum) { + ASSERT(dwStreamObjNum); + return m_pDocPage->GetImage(dwStreamObjNum); } void CPDF_Document::CreateNewDoc() { diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h index fce84001b9..73c8666686 100644 --- a/core/fpdfapi/parser/cpdf_document.h +++ b/core/fpdfapi/parser/cpdf_document.h @@ -81,7 +81,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder { bool bShading, const CFX_Matrix& matrix); - CPDF_Image* LoadImageF(CPDF_Object* pObj); + CPDF_Image* LoadImageFromPageData(uint32_t dwStreamObjNum); CPDF_StreamAcc* LoadFontFile(CPDF_Stream* pStream); CPDF_IccProfile* LoadIccProfile(CPDF_Stream* pStream); |