summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cfdf_document.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-04 16:00:03 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-04 16:00:03 -0700
commit931d087b991a986cc8bfa72131fe8eda0d987fc4 (patch)
tree53099f287c7c1dc83349aae6d3930a9462767518 /core/fpdfapi/parser/cfdf_document.cpp
parent1d08c50d1c20798001a1944e8a1fd76d09643ef1 (diff)
downloadpdfium-931d087b991a986cc8bfa72131fe8eda0d987fc4.tar.xz
Pass object to ReplaceIndirectObjectIfHigherGeneration() by unique_ptr.
Review-Url: https://codereview.chromium.org/2477003002
Diffstat (limited to 'core/fpdfapi/parser/cfdf_document.cpp')
-rw-r--r--core/fpdfapi/parser/cfdf_document.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp
index e66bfeb12b..a0f3e1490d 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -69,11 +69,12 @@ void CFDF_Document::ParseStream(IFX_SeekableReadStream* pFile, bool bOwnFile) {
if (word != "obj")
break;
- CPDF_Object* pObj = parser.GetObject(this, objnum, 0, true);
+ auto pObj = pdfium::WrapUnique<CPDF_Object>(
+ parser.GetObject(this, objnum, 0, true));
if (!pObj)
break;
- ReplaceIndirectObjectIfHigherGeneration(objnum, pObj);
+ ReplaceIndirectObjectIfHigherGeneration(objnum, std::move(pObj));
word = parser.GetNextWord(nullptr);
if (word != "endobj")
break;