summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index f057ce7d90..5c085ab732 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -4113,6 +4113,7 @@ FX_BOOL CPDF_DataAvail::CheckTrailerAppend(IFX_DownloadHints* pHints) {
}
return TRUE;
}
+
FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) {
int32_t iTrailerSize =
(int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512);
@@ -4130,13 +4131,14 @@ FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) {
CFX_SmartPointer<IFX_FileStream> file(
FX_CreateMemoryStream(pBuf, (size_t)iSize, FALSE));
m_syntaxParser.InitParser(file.Get(), 0);
- CPDF_Object* pTrailer = m_syntaxParser.GetObject(NULL, 0, 0, 0);
+ CPDF_Object* pTrailer = m_syntaxParser.GetObject(nullptr, 0, 0);
if (!pTrailer) {
m_Pos += m_syntaxParser.SavePos();
pHints->AddSegment(m_Pos, iTrailerSize);
return FALSE;
}
if (pTrailer->GetType() != PDFOBJ_DICTIONARY) {
+ pTrailer->Release();
return FALSE;
}
CPDF_Dictionary* pTrailerDict = pTrailer->GetDict();
@@ -4174,6 +4176,7 @@ FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) {
pHints->AddSegment(m_Pos, iTrailerSize);
return FALSE;
}
+
FX_BOOL CPDF_DataAvail::CheckPage(int32_t iPage, IFX_DownloadHints* pHints) {
while (TRUE) {
switch (m_docStatus) {