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 23efb52596..21b2fbae8a 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -4104,6 +4104,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);
@@ -4121,13 +4122,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();
@@ -4165,6 +4167,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) {