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

Unified Diff: core/fxcrt/fx_basic_array.cpp

Issue 2640143003: Update safe numerics package to get bitwise ops (Closed)
Patch Set: Address reviewer comments Created 3 years, 11 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 | « core/fxcrt/cfx_string_data_template.h ('k') | core/fxcrt/fx_basic_util.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_array.cpp
diff --git a/core/fxcrt/fx_basic_array.cpp b/core/fxcrt/fx_basic_array.cpp
index 92df0e00f8d4b9d6789382a0d147dc64fb15f119..83c981e9e7643e67f77d06e3afdef08920a05540 100644
--- a/core/fxcrt/fx_basic_array.cpp
+++ b/core/fxcrt/fx_basic_array.cpp
@@ -33,7 +33,8 @@ bool CFX_BasicArray::SetSize(int nNewSize) {
m_nSize = m_nMaxSize = 0;
return false;
}
- m_pData = FX_Alloc(uint8_t, totalSize.ValueOrDie());
+ m_pData =
+ FX_Alloc(uint8_t, pdfium::base::ValueOrDieForType<size_t>(totalSize));
m_nSize = m_nMaxSize = nNewSize;
} else if (nNewSize <= m_nMaxSize) {
if (nNewSize > m_nSize) {
@@ -48,7 +49,8 @@ bool CFX_BasicArray::SetSize(int nNewSize) {
if (!totalSize.IsValid() || nNewMax < m_nSize) {
return false;
}
- uint8_t* pNewData = FX_Realloc(uint8_t, m_pData, totalSize.ValueOrDie());
+ uint8_t* pNewData = FX_Realloc(
+ uint8_t, m_pData, pdfium::base::ValueOrDieForType<size_t>(totalSize));
if (!pNewData) {
return false;
}
« no previous file with comments | « core/fxcrt/cfx_string_data_template.h ('k') | core/fxcrt/fx_basic_util.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698