summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/fx_basic_array.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-05-19 14:48:00 -0700
committerTom Sepez <tsepez@chromium.org>2015-05-19 14:48:00 -0700
commiteb6527763171cdb4b0fbfea5a20d691f4d67b660 (patch)
tree7781d0fb716b95696b9f411037508244f4cfc28a /core/src/fxcrt/fx_basic_array.cpp
parent59f4b44d1fbb259967ea518e0bf5fa76b0cc9767 (diff)
downloadpdfium-eb6527763171cdb4b0fbfea5a20d691f4d67b660.tar.xz
Remove FX_Alloc() null checks now that it can't return NULL.
This permits some functions to become void's since they, in turn, can't fail. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1142713005
Diffstat (limited to 'core/src/fxcrt/fx_basic_array.cpp')
-rw-r--r--core/src/fxcrt/fx_basic_array.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/core/src/fxcrt/fx_basic_array.cpp b/core/src/fxcrt/fx_basic_array.cpp
index 5a2a2e54a1..43a5417c00 100644
--- a/core/src/fxcrt/fx_basic_array.cpp
+++ b/core/src/fxcrt/fx_basic_array.cpp
@@ -39,10 +39,6 @@ FX_BOOL CFX_BasicArray::SetSize(int nNewSize)
return FALSE;
}
m_pData = FX_Alloc(FX_BYTE, totalSize.ValueOrDie());
- if (!m_pData) {
- m_nSize = m_nMaxSize = 0;
- return FALSE;
- }
m_nSize = m_nMaxSize = nNewSize;
} else if (nNewSize <= m_nMaxSize) {
if (nNewSize > m_nSize) {
@@ -197,10 +193,6 @@ void* CFX_BaseSegmentedArray::Add()
}
if (m_IndexDepth == 0) {
void** pIndex = (void**)FX_Alloc(void*, m_IndexSize);
- if (pIndex == NULL) {
- FX_Free(pSegment);
- return NULL;
- }
pIndex[0] = m_pIndex;
pIndex[1] = pSegment;
m_pIndex = pIndex;
@@ -222,10 +214,6 @@ void* CFX_BaseSegmentedArray::Add()
}
if (m_DataSize == tree_size * m_SegmentSize) {
void** pIndex = (void**)FX_Alloc(void*, m_IndexSize);
- if (pIndex == NULL) {
- FX_Free(pSegment);
- return NULL;
- }
pIndex[0] = m_pIndex;
m_pIndex = pIndex;
m_IndexDepth ++;
@@ -236,9 +224,6 @@ void* CFX_BaseSegmentedArray::Add()
for (i = 1; i < m_IndexDepth; i ++) {
if (pSpot[seg_index / tree_size] == NULL) {
pSpot[seg_index / tree_size] = (void*)FX_Alloc(void*, m_IndexSize);
- if (pSpot[seg_index / tree_size] == NULL) {
- break;
- }
}
pSpot = (void**)pSpot[seg_index / tree_size];
seg_index = seg_index % tree_size;