| Index: core/fpdfapi/parser/cpdf_data_avail.cpp
|
| diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp
|
| index a077ebb7150fb386903b2566a4a364491e38e23c..eadbf1e8282c144c0e5f72c4f3783e18668bd033 100644
|
| --- a/core/fpdfapi/parser/cpdf_data_avail.cpp
|
| +++ b/core/fpdfapi/parser/cpdf_data_avail.cpp
|
| @@ -83,17 +83,12 @@ CPDF_DataAvail::CPDF_DataAvail(FileAvail* pFileAvail,
|
|
|
| CPDF_DataAvail::~CPDF_DataAvail() {
|
| m_pHintTables.reset();
|
| - if (m_pLinearized)
|
| - m_pLinearized->Release();
|
| -
|
| - if (m_pRoot)
|
| - m_pRoot->Release();
|
| -
|
| - if (m_pTrailer)
|
| - m_pTrailer->Release();
|
| + delete m_pLinearized;
|
| + delete m_pRoot;
|
| + delete m_pTrailer;
|
|
|
| for (CPDF_Object* pObject : m_arrayAcroforms)
|
| - pObject->Release();
|
| + delete pObject;
|
| }
|
|
|
| void CPDF_DataAvail::SetDocument(CPDF_Document* pDoc) {
|
| @@ -230,7 +225,7 @@ bool CPDF_DataAvail::CheckAcroFormSubObject(DownloadHints* pHints) {
|
| }
|
|
|
| for (CPDF_Object* pObject : m_arrayAcroforms)
|
| - pObject->Release();
|
| + delete pObject;
|
|
|
| m_arrayAcroforms.clear();
|
| return true;
|
| @@ -400,9 +395,7 @@ bool CPDF_DataAvail::CheckInfo(DownloadHints* pHints) {
|
| return false;
|
| }
|
|
|
| - if (pInfo)
|
| - pInfo->Release();
|
| -
|
| + delete pInfo;
|
| m_docStatus =
|
| (m_bHaveAcroForm ? PDF_DATAAVAIL_ACROFORM : PDF_DATAAVAIL_PAGETREE);
|
|
|
| @@ -499,7 +492,7 @@ bool CPDF_DataAvail::CheckPage(DownloadHints* pHints) {
|
| }
|
|
|
| if (!pObj->IsDictionary()) {
|
| - pObj->Release();
|
| + delete pObj;
|
| continue;
|
| }
|
|
|
| @@ -508,7 +501,7 @@ bool CPDF_DataAvail::CheckPage(DownloadHints* pHints) {
|
| m_PagesArray.push_back(pObj);
|
| continue;
|
| }
|
| - pObj->Release();
|
| + delete pObj;
|
| }
|
|
|
| m_PageObjList.RemoveAll();
|
| @@ -524,15 +517,15 @@ bool CPDF_DataAvail::CheckPage(DownloadHints* pHints) {
|
| continue;
|
|
|
| if (!GetPageKids(m_pCurrentParser, pPages)) {
|
| - pPages->Release();
|
| + delete pPages;
|
| while (++i < iPages)
|
| - m_PagesArray[i]->Release();
|
| + delete m_PagesArray[i];
|
|
|
| m_PagesArray.clear();
|
| m_docStatus = PDF_DATAAVAIL_ERROR;
|
| return false;
|
| }
|
| - pPages->Release();
|
| + delete pPages;
|
| }
|
|
|
| m_PagesArray.clear();
|
| @@ -587,12 +580,12 @@ bool CPDF_DataAvail::CheckPages(DownloadHints* pHints) {
|
| }
|
|
|
| if (!GetPageKids(m_pCurrentParser, pPages)) {
|
| - pPages->Release();
|
| + delete pPages;
|
| m_docStatus = PDF_DATAAVAIL_ERROR;
|
| return false;
|
| }
|
|
|
| - pPages->Release();
|
| + delete pPages;
|
| m_docStatus = PDF_DATAAVAIL_PAGE;
|
| return true;
|
| }
|
| @@ -763,7 +756,7 @@ bool CPDF_DataAvail::CheckHintTables(DownloadHints* pHints) {
|
|
|
| std::unique_ptr<CPDF_HintTables> pHintTables(
|
| new CPDF_HintTables(this, pDict));
|
| - std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pHintStream(
|
| + std::unique_ptr<CPDF_Object> pHintStream(
|
| ParseIndirectObjectAt(szHintStart, 0));
|
| CPDF_Stream* pStream = ToStream(pHintStream.get());
|
| if (pStream && pHintTables->LoadHintStream(pStream))
|
| @@ -951,11 +944,11 @@ int32_t CPDF_DataAvail::CheckCrossRefStream(DownloadHints* pHints,
|
| if (pName->GetString() == "XRef") {
|
| m_Pos += m_parser.m_pSyntax->SavePos();
|
| xref_offset = pObj->GetDict()->GetIntegerFor("Prev");
|
| - pObj->Release();
|
| + delete pObj;
|
| return 1;
|
| }
|
| }
|
| - pObj->Release();
|
| + delete pObj;
|
| return -1;
|
| }
|
| pHints->AddSegment(m_Pos, req_size);
|
| @@ -1181,7 +1174,7 @@ bool CPDF_DataAvail::CheckTrailer(DownloadHints* pHints) {
|
| ScopedFileStream file(FX_CreateMemoryStream(pBuf, (size_t)iSize, false));
|
| m_syntaxParser.InitParser(file.get(), 0);
|
|
|
| - std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pTrailer(
|
| + std::unique_ptr<CPDF_Object> pTrailer(
|
| m_syntaxParser.GetObject(nullptr, 0, 0, true));
|
| if (!pTrailer) {
|
| m_Pos += m_syntaxParser.SavePos();
|
| @@ -1266,7 +1259,7 @@ bool CPDF_DataAvail::CheckArrayPageNode(uint32_t dwPageNo,
|
|
|
| CPDF_Array* pArray = pPages->AsArray();
|
| if (!pArray) {
|
| - pPages->Release();
|
| + delete pPages;
|
| m_docStatus = PDF_DATAAVAIL_ERROR;
|
| return false;
|
| }
|
| @@ -1281,7 +1274,7 @@ bool CPDF_DataAvail::CheckArrayPageNode(uint32_t dwPageNo,
|
| pPageNode->m_childNode.Add(pNode);
|
| pNode->m_dwPageNo = pKid->GetRefObjNum();
|
| }
|
| - pPages->Release();
|
| + delete pPages;
|
| return true;
|
| }
|
|
|
| @@ -1304,12 +1297,12 @@ bool CPDF_DataAvail::CheckUnkownPageNode(uint32_t dwPageNo,
|
| if (pPage->IsArray()) {
|
| pPageNode->m_dwPageNo = dwPageNo;
|
| pPageNode->m_type = PDF_PAGENODE_ARRAY;
|
| - pPage->Release();
|
| + delete pPage;
|
| return true;
|
| }
|
|
|
| if (!pPage->IsDictionary()) {
|
| - pPage->Release();
|
| + delete pPage;
|
| m_docStatus = PDF_DATAAVAIL_ERROR;
|
| return false;
|
| }
|
| @@ -1350,11 +1343,11 @@ bool CPDF_DataAvail::CheckUnkownPageNode(uint32_t dwPageNo,
|
| } else if (type == "Page") {
|
| pPageNode->m_type = PDF_PAGENODE_PAGE;
|
| } else {
|
| - pPage->Release();
|
| + delete pPage;
|
| m_docStatus = PDF_DATAAVAIL_ERROR;
|
| return false;
|
| }
|
| - pPage->Release();
|
| + delete pPage;
|
| return true;
|
| }
|
|
|
| @@ -1442,23 +1435,23 @@ bool CPDF_DataAvail::CheckPageCount(DownloadHints* pHints) {
|
|
|
| CPDF_Dictionary* pPagesDict = pPages->GetDict();
|
| if (!pPagesDict) {
|
| - pPages->Release();
|
| + delete pPages;
|
| m_docStatus = PDF_DATAAVAIL_ERROR;
|
| return false;
|
| }
|
|
|
| if (!pPagesDict->KeyExist("Kids")) {
|
| - pPages->Release();
|
| + delete pPages;
|
| return true;
|
| }
|
|
|
| int count = pPagesDict->GetIntegerFor("Count");
|
| if (count > 0) {
|
| - pPages->Release();
|
| + delete pPages;
|
| return true;
|
| }
|
|
|
| - pPages->Release();
|
| + delete pPages;
|
| return false;
|
| }
|
|
|
|
|