summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-10-14 17:45:56 -0700
committerTom Sepez <tsepez@chromium.org>2016-10-14 17:45:56 -0700
commitc25a4219431c90a95233a08f25eecc921abbf3ed (patch)
treebd2ad923d527440785c19623fe2d19cc1a70a92d /core/fpdfapi/parser/cpdf_parser.cpp
parent62f367348ff8ff1e64c6f52c1ee5f77c3a89edc1 (diff)
downloadpdfium-c25a4219431c90a95233a08f25eecc921abbf3ed.tar.xz
Revert "Update CPDF_IndirectObjectHolder APIs for unique objects."
This reverts commit 3ba098595ae56b64eacc0c25ab76b89a4d78d920. TBR=thestig@chromium.org,weili@chromium.org Review URL: https://codereview.chromium.org/2424533003 .
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index d9c892f133..40a615fa47 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -955,18 +955,21 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() {
}
FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE* pos, FX_BOOL bMainXRef) {
- UniqueObject pObject(ParseIndirectObjectAt(m_pDocument, *pos, 0));
+ std::unique_ptr<CPDF_Object> pObject(
+ ParseIndirectObjectAt(m_pDocument, *pos, 0));
if (!pObject)
return FALSE;
CPDF_Object* pUnownedObject = pObject.get();
+
if (m_pDocument) {
CPDF_Dictionary* pRootDict = m_pDocument->GetRoot();
if (pRootDict && pRootDict->GetObjNum() == pObject->m_ObjNum)
return FALSE;
+ // Takes ownership of object (std::move someday).
uint32_t objnum = pObject->m_ObjNum;
if (!m_pDocument->ReplaceIndirectObjectIfHigherGeneration(
- objnum, std::move(pObject))) {
+ objnum, pObject.release())) {
return FALSE;
}
}