summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_hint_tables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_hint_tables.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_hint_tables.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/fpdfapi/parser/cpdf_hint_tables.cpp b/core/fpdfapi/parser/cpdf_hint_tables.cpp
index 7a5eb2397b..e88da2eea8 100644
--- a/core/fpdfapi/parser/cpdf_hint_tables.cpp
+++ b/core/fpdfapi/parser/cpdf_hint_tables.cpp
@@ -13,6 +13,7 @@
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_linearized_header.h"
+#include "core/fpdfapi/parser/cpdf_read_validator.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fxcrt/cfx_bitstream.h"
@@ -35,9 +36,9 @@ bool IsValidPageOffsetHintTableBitCount(uint32_t bits) {
} // namespace
-CPDF_HintTables::CPDF_HintTables(CPDF_DataAvail* pDataAvail,
+CPDF_HintTables::CPDF_HintTables(CPDF_ReadValidator* pValidator,
CPDF_LinearizedHeader* pLinearized)
- : m_pDataAvail(pDataAvail),
+ : m_pValidator(pValidator),
m_pLinearized(pLinearized),
m_nFirstPageSharedObjs(0),
m_szFirstPageObjOffset(0) {
@@ -413,7 +414,8 @@ CPDF_DataAvail::DocAvailStatus CPDF_HintTables::CheckPage(uint32_t index) {
if (!dwLength)
return CPDF_DataAvail::DataError;
- if (!m_pDataAvail->IsDataAvail(m_szPageOffsetArray[index], dwLength))
+ if (!m_pValidator->CheckDataRangeAndRequestIfUnavailable(
+ m_szPageOffsetArray[index], dwLength))
return CPDF_DataAvail::DataNotAvailable;
// Download data of shared objects in the page.
@@ -444,8 +446,8 @@ CPDF_DataAvail::DocAvailStatus CPDF_HintTables::CheckPage(uint32_t index) {
if (!dwLength)
return CPDF_DataAvail::DataError;
- if (!m_pDataAvail->IsDataAvail(m_szSharedObjOffsetArray[dwIndex],
- dwLength)) {
+ if (!m_pValidator->CheckDataRangeAndRequestIfUnavailable(
+ m_szSharedObjOffsetArray[dwIndex], dwLength)) {
return CPDF_DataAvail::DataNotAvailable;
}
}