diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-05-20 09:50:37 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-05-20 09:50:37 -0700 |
commit | d50b172a9d3a05704748f0798b5aaa422485abbd (patch) | |
tree | 0289d99b370b8526c539fc676004bf622f5228a3 /core/src/fxge/agg | |
parent | 90a4181194dd8eca153cf2a101ec27e382b27a58 (diff) | |
download | pdfium-d50b172a9d3a05704748f0798b5aaa422485abbd.tar.xz |
Merge to XFA: Remove FX_Alloc() null checks now that it can't return NULL.
Original Review URL: https://codereview.chromium.org/1142713005
R=thestig@chromium.org
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1143663008
Diffstat (limited to 'core/src/fxge/agg')
-rw-r--r-- | core/src/fxge/agg/agg23/agg_array.h | 6 | ||||
-rw-r--r-- | core/src/fxge/agg/agg23/fx_agg_path_storage.cpp | 3 | ||||
-rw-r--r-- | core/src/fxge/agg/agg23/fx_agg_rasterizer_scanline_aa.cpp | 6 |
3 files changed, 1 insertions, 14 deletions
diff --git a/core/src/fxge/agg/agg23/agg_array.h b/core/src/fxge/agg/agg23/agg_array.h index b3b5f2b877..810eb4ef22 100644 --- a/core/src/fxge/agg/agg23/agg_array.h +++ b/core/src/fxge/agg/agg23/agg_array.h @@ -111,12 +111,8 @@ void pod_array<T>::capacity(unsigned cap, unsigned extra_tail) m_capacity = 0; } else if(full_cap > m_capacity) { FX_Free(m_array); - m_array = 0; - m_capacity = 0; m_array = FX_Alloc(T, full_cap); - if (m_array) { - m_capacity = full_cap; - } + m_capacity = full_cap; } } template<class T> diff --git a/core/src/fxge/agg/agg23/fx_agg_path_storage.cpp b/core/src/fxge/agg/agg23/fx_agg_path_storage.cpp index b4b184e0a4..b62d4baa1c 100644 --- a/core/src/fxge/agg/agg23/fx_agg_path_storage.cpp +++ b/core/src/fxge/agg/agg23/fx_agg_path_storage.cpp @@ -71,9 +71,6 @@ void path_storage::allocate_block(unsigned nb) FX_Alloc( FX_FLOAT, block_size * 2 + block_size / (sizeof(FX_FLOAT) / sizeof(unsigned char))); - if (!m_coord_blocks[nb]) { - return; - } m_cmd_blocks[nb] = (unsigned char*)(m_coord_blocks[nb] + block_size * 2); m_total_blocks++; diff --git a/core/src/fxge/agg/agg23/fx_agg_rasterizer_scanline_aa.cpp b/core/src/fxge/agg/agg23/fx_agg_rasterizer_scanline_aa.cpp index 634d10a3be..1c32d96cab 100644 --- a/core/src/fxge/agg/agg23/fx_agg_rasterizer_scanline_aa.cpp +++ b/core/src/fxge/agg/agg23/fx_agg_rasterizer_scanline_aa.cpp @@ -117,9 +117,6 @@ void outline_aa::allocate_block() if(m_cur_block >= m_num_blocks) { if(m_num_blocks >= m_max_blocks) { cell_aa** new_cells = FX_Alloc( cell_aa*, m_max_blocks + cell_block_pool); - if (!new_cells) { - return; - } if(m_cells) { FXSYS_memcpy32(new_cells, m_cells, m_max_blocks * sizeof(cell_aa*)); FX_Free(m_cells); @@ -128,9 +125,6 @@ void outline_aa::allocate_block() m_max_blocks += cell_block_pool; } m_cells[m_num_blocks++] = FX_Alloc(cell_aa, cell_block_size); - if (!m_cells[m_num_blocks - 1]) { - return; - } } m_cur_cell_ptr = m_cells[m_cur_block++]; } |