diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-05-19 14:56:52 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-05-19 14:56:52 -0700 |
commit | bf4aa2cc93a67826247e887b2ba26a1b965eb616 (patch) | |
tree | a1d6336676d6d70467a7fb94aa0e625b1dbc8c25 /core/src/fxge/agg/agg23/agg_array.h | |
parent | eb6527763171cdb4b0fbfea5a20d691f4d67b660 (diff) | |
download | pdfium-bf4aa2cc93a67826247e887b2ba26a1b965eb616.tar.xz |
Revert "Remove FX_Alloc() null checks now that it can't return NULL."
This reverts commit eb6527763171cdb4b0fbfea5a20d691f4d67b660.
Reason for revert: broke javascript tests.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1145843005
Diffstat (limited to 'core/src/fxge/agg/agg23/agg_array.h')
-rw-r--r-- | core/src/fxge/agg/agg23/agg_array.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/fxge/agg/agg23/agg_array.h b/core/src/fxge/agg/agg23/agg_array.h index 810eb4ef22..b3b5f2b877 100644 --- a/core/src/fxge/agg/agg23/agg_array.h +++ b/core/src/fxge/agg/agg23/agg_array.h @@ -111,8 +111,12 @@ 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); - m_capacity = full_cap; + if (m_array) { + m_capacity = full_cap; + } } } template<class T> |