summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp4
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
index a4b85a34fa..15f98b26b9 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
@@ -716,10 +716,10 @@ FX_BOOL CPDF_DataAvail::CheckFirstPage(IPDF_DataAvail::DownloadHints* pHints) {
FX_BOOL CPDF_DataAvail::IsDataAvail(FX_FILESIZE offset,
uint32_t size,
IPDF_DataAvail::DownloadHints* pHints) {
- if (offset > m_dwFileLen)
+ if (offset < 0 || offset > m_dwFileLen)
return TRUE;
- FX_SAFE_DWORD safeSize = pdfium::base::checked_cast<uint32_t>(offset);
+ FX_SAFE_FILESIZE safeSize = offset;
safeSize += size;
safeSize += 512;
if (!safeSize.IsValid() || safeSize.ValueOrDie() > m_dwFileLen)
diff --git a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
index 26b6a8d3df..04fe6f4fec 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
@@ -83,7 +83,7 @@ class CPDF_SyntaxParser {
FX_FILESIZE m_Pos;
int m_MetadataObjnum;
IFX_FileRead* m_pFileAccess;
- uint32_t m_HeaderOffset;
+ FX_FILESIZE m_HeaderOffset;
FX_FILESIZE m_FileLen;
uint8_t* m_pFileBuf;
uint32_t m_BufSize;