Index: core/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
index 18a2e2d88225e5df50b28b6793a40a95cec33ea2..ad1d288579bdaf26b01264d986b4ef055cfe48fb 100644 |
--- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
+++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp |
@@ -248,24 +248,19 @@ CPDF_StreamContentParser::CPDF_StreamContentParser( |
CPDF_StreamContentParser::~CPDF_StreamContentParser() { |
ClearAllParams(); |
FX_Free(m_pPathPoints); |
- if (m_pLastImageDict) { |
- m_pLastImageDict->Release(); |
- } |
- if (m_pLastCloneImageDict) { |
- m_pLastCloneImageDict->Release(); |
- } |
+ delete m_pLastImageDict; |
+ delete m_pLastCloneImageDict; |
} |
int CPDF_StreamContentParser::GetNextParamPos() { |
if (m_ParamCount == PARAM_BUF_SIZE) { |
m_ParamStartPos++; |
- if (m_ParamStartPos == PARAM_BUF_SIZE) { |
+ if (m_ParamStartPos == PARAM_BUF_SIZE) |
m_ParamStartPos = 0; |
- } |
- if (m_ParamBuf[m_ParamStartPos].m_Type == 0) { |
- if (CPDF_Object* pObject = m_ParamBuf[m_ParamStartPos].m_pObject) |
- pObject->Release(); |
- } |
+ |
+ if (m_ParamBuf[m_ParamStartPos].m_Type == 0) |
+ delete m_ParamBuf[m_ParamStartPos].m_pObject; |
+ |
return m_ParamStartPos; |
} |
int index = m_ParamStartPos + m_ParamCount; |
@@ -312,14 +307,12 @@ void CPDF_StreamContentParser::AddObjectParam(CPDF_Object* pObj) { |
void CPDF_StreamContentParser::ClearAllParams() { |
uint32_t index = m_ParamStartPos; |
for (uint32_t i = 0; i < m_ParamCount; i++) { |
- if (m_ParamBuf[index].m_Type == 0) { |
- if (CPDF_Object* pObject = m_ParamBuf[index].m_pObject) |
- pObject->Release(); |
- } |
+ if (m_ParamBuf[index].m_Type == 0) |
+ delete m_ParamBuf[index].m_pObject; |
+ |
index++; |
- if (index == PARAM_BUF_SIZE) { |
+ if (index == PARAM_BUF_SIZE) |
index = 0; |
- } |
} |
m_ParamStartPos = 0; |
m_ParamCount = 0; |
@@ -599,7 +592,7 @@ void CPDF_StreamContentParser::Handle_BeginImage() { |
m_pSyntax->GetWordSize()); |
if (bsKeyword != "ID") { |
m_pSyntax->SetPos(savePos); |
- pDict->Release(); |
+ delete pDict; |
return; |
} |
} |
@@ -608,8 +601,7 @@ void CPDF_StreamContentParser::Handle_BeginImage() { |
} |
CFX_ByteString key((const FX_CHAR*)m_pSyntax->GetWordBuf() + 1, |
m_pSyntax->GetWordSize() - 1); |
- std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pObj( |
- m_pSyntax->ReadNextObject(false, 0)); |
+ std::unique_ptr<CPDF_Object> pObj(m_pSyntax->ReadNextObject(false, 0)); |
if (!key.IsEmpty()) { |
uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0; |
if (dwObjNum) |
@@ -652,9 +644,9 @@ void CPDF_StreamContentParser::Handle_BeginImage() { |
CPDF_ImageObject* pImgObj = AddImage(pStream, nullptr, true); |
if (!pImgObj) { |
if (pStream) { |
- pStream->Release(); |
+ delete pStream; |
} else { |
- pDict->Release(); |
+ delete pDict; |
} |
} |
} |