From bde6f35d285b0415cdcaf92e58fbe276bc499255 Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Sat, 29 Jul 2017 00:50:31 +0300 Subject: Unify cross ref item check. Change-Id: I7c68d0f5a668019d23bbeebc66373f9b245f91a2 Reviewed-on: https://pdfium-review.googlesource.com/9551 Reviewed-by: dsinclair Commit-Queue: Art Snake --- core/fpdfapi/parser/cpdf_data_avail.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'core') diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp index 8370b8cd5f..0d87543145 100644 --- a/core/fpdfapi/parser/cpdf_data_avail.cpp +++ b/core/fpdfapi/parser/cpdf_data_avail.cpp @@ -979,22 +979,8 @@ bool CPDF_DataAvail::CheckCrossRef(DownloadHints* pHints) { return true; } - while (1) { - if (!GetNextToken(&token)) { - iSize = static_cast( - m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512); - pHints->AddSegment(m_Pos, iSize); - m_docStatus = PDF_DATAAVAIL_CROSSREF_ITEM; - return false; - } - - if (token == "trailer") { - m_dwTrailerOffset = m_Pos; - m_docStatus = PDF_DATAAVAIL_TRAILER; - return true; - } - } - return false; + m_docStatus = PDF_DATAAVAIL_CROSSREF_ITEM; + return true; } bool CPDF_DataAvail::CheckTrailerAppend(DownloadHints* pHints) { -- cgit v1.2.3