diff options
author | weili <weili@chromium.org> | 2016-03-31 15:08:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-31 15:08:27 -0700 |
commit | 47ca692c8150cb39abef5737e866b91e6a105b80 (patch) | |
tree | cba8531fe7a569cfa7f05dc84f158bf1cf15be23 /core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp | |
parent | de0d852ed91973deda41f949e132b12a2efff1ef (diff) | |
download | pdfium-47ca692c8150cb39abef5737e866b91e6a105b80.tar.xz |
Re-enable all the windows warnings except 4267
The code is changed or had been changed to no longer generate these
warnings. It is safe to re-enabled these warnings.
In this code change, we fixed some code which generates warnings 4018
(signed/unsigned mismatch) and 4146 (unary minus operator applied to
unsigned type, result still unsigned).
Warning 4333 (right shift by too large amount, data loss) and 4345
(an object of POD type constructed with an initializer of the form ()
will be default-initialized) are no longer generated.
The same setting is applied and verified for GN build as well.
BUG=pdfium:29
Review URL: https://codereview.chromium.org/1849443003
Diffstat (limited to 'core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp | 4 |
1 files changed, 2 insertions, 2 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) |