| 1 | diff --git a/3rdparty/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp b/3rdparty/pdfium/fpdfsdk/fpdf_dataavail_embeddertest.cpp
|
| 2 | index cc95c1b..e40ca2e 100644
|
| 3 | |
| 4 | |
| 5 | @@ -12,6 +12,7 @@
|
| 6 | #include "testing/gtest/include/gtest/gtest.h"
|
| 7 | #include "testing/test_support.h"
|
| 8 | #include "testing/utils/path_service.h"
|
| 9 | +#include "third_party/base/numerics/safe_conversions.h"
|
| 10 |
|
| 11 | namespace {
|
| 12 | class TestAsyncLoader : public FX_DOWNLOADHINTS, FX_FILEAVAIL {
|
| 13 | @@ -24,7 +25,8 @@ class TestAsyncLoader : public FX_DOWNLOADHINTS, FX_FILEAVAIL {
|
| 14 | if (!file_contents_)
|
| 15 | return;
|
| 16 |
|
| 17 | - file_access_.m_FileLen = static_cast<unsigned long>(file_length_);
|
| 18 | + file_access_.m_FileLen =
|
| 19 | + pdfium::base::checked_cast<unsigned long>(file_length_);
|
| 20 | file_access_.m_GetBlock = SGetBlock;
|
| 21 | file_access_.m_Param = this;
|
| 22 |
|
| 23 | @@ -107,8 +109,8 @@ class TestAsyncLoader : public FX_DOWNLOADHINTS, FX_FILEAVAIL {
|
| 24 | int GetBlockImpl(unsigned long pos, unsigned char* pBuf, unsigned long size) {
|
| 25 | if (!IsDataAvailImpl(pos, size))
|
| 26 | return 0;
|
| 27 | - const unsigned long end =
|
| 28 | - std::min(static_cast<unsigned long>(file_length_), pos + size);
|
| 29 | + const unsigned long end = std::min(
|
| 30 | + pdfium::base::checked_cast<unsigned long>(file_length_), pos + size);
|
| 31 | if (end <= pos)
|
| 32 | return 0;
|
| 33 | memcpy(pBuf, file_contents_.get() + pos, end - pos);
|
| 34 | diff --git a/3rdparty/pdfium/testing/embedder_test.cpp b/3rdparty/pdfium/testing/embedder_test.cpp
|
| 35 | index c23b5c8..f8fd2a1 100644
|
| 36 | |
| 37 | |
| 38 | @@ -130,7 +130,8 @@ bool EmbedderTest::OpenDocument(const std::string& filename,
|
| 39 |
|
| 40 | EXPECT_TRUE(!loader_);
|
| 41 | loader_ = new TestLoader(file_contents_.get(), file_length_);
|
| 42 | - file_access_.m_FileLen = static_cast<unsigned long>(file_length_);
|
| 43 | + file_access_.m_FileLen =
|
| 44 | + pdfium::base::checked_cast<unsigned long>(file_length_);
|
| 45 | file_access_.m_GetBlock = TestLoader::GetBlock;
|
| 46 | file_access_.m_Param = loader_;
|
| 47 |
|