From e7e454da8e382513b9e271bb3e0be3bd901bfbd9 Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Wed, 11 Jul 2018 13:43:52 +0000 Subject: Do not store cross ref v5 obj within document. Currently, not necessary to store the cross ref v5 obj within CPDF_IndirectObjectHolder(CPDF_Document), because all necessary data from the cross ref are parsed or cloned, and owned by CPDF_Parser seperately from CPDF_IndirectObjectHolder. Also this fix regression from commit 4ea4459e. BUG=chromium:810768 Change-Id: I0d1a11ff027210f4f15804a69d12416838ec9815 Reviewed-on: https://pdfium-review.googlesource.com/37110 Reviewed-by: Lei Zhang Commit-Queue: Art Snake --- core/fpdfapi/parser/cpdf_parser.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'core') diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp index e372f1272c..f7846eff31 100644 --- a/core/fpdfapi/parser/cpdf_parser.cpp +++ b/core/fpdfapi/parser/cpdf_parser.cpp @@ -977,16 +977,7 @@ bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE* pos, bool bMainXRef) { if (!objnum) return false; - CPDF_Object* pUnownedObject = pObject.get(); - const CPDF_Dictionary* pRootDict = GetRoot(); - if (pRootDict && pRootDict->GetObjNum() == objnum) - return false; - if (!m_pObjectsHolder->ReplaceIndirectObjectIfHigherGeneration( - objnum, std::move(pObject))) { - return false; - } - - CPDF_Stream* pStream = pUnownedObject->AsStream(); + CPDF_Stream* pStream = pObject->AsStream(); if (!pStream) return false; -- cgit v1.2.3