Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp

Issue 1849443003: Re-enable all the windows warnings except 4267 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Address comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a4b85a34faa2fc3905c60707e56b89ea4052dafa..15f98b26b9d60c3622bc1933f2e5542b833feb41 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)
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698