Index: core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp |
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp |
index a8cbeaf5d4e3544473b089f614e28ce6099ee4ce..c451d9c06088f110b1f6e121a2e4c78bf7e7d00a 100644 |
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp |
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp |
@@ -1423,6 +1423,8 @@ FX_BOOL CPDF_DataAvail::CheckPageNode(CPDF_DataAvail::PageNode& pageNodes, |
FX_BOOL CPDF_DataAvail::LoadDocPage(uint32_t dwPage, DownloadHints* pHints) { |
FX_SAFE_INT32 safePage = pdfium::base::checked_cast<int32_t>(dwPage); |
int32_t iPage = safePage.ValueOrDie(); |
+ // TODO(dsinclair): This won't work correctly for XFA as the pageList in |
+ // the document does not contain XFA pages. |
npm
2016/09/21 21:59:22
I think I don't understand. You are not changing t
dsinclair
2016/09/22 14:06:02
The problem I see here is that, the page count for
|
if (m_pDocument->GetPageCount() <= iPage || |
m_pDocument->IsPageLoaded(iPage)) { |
m_docStatus = PDF_DATAAVAIL_DONE; |
@@ -1764,6 +1766,7 @@ int CPDF_DataAvail::GetPageCount() const { |
CPDF_Object* pObj = pDict ? pDict->GetDirectObjectFor("N") : nullptr; |
return pObj ? pObj->GetInteger() : 0; |
} |
+ // TODO(dsinclair): This will be wrong for XFA documents. |
return m_pDocument ? m_pDocument->GetPageCount() : 0; |
} |