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

Unified Diff: core/src/fxge/agg/agg23/agg_array.h

Issue 1145843005: Revert "Remove FX_Alloc() null checks now that it can't return NULL." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 7 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/src/fxcrt/xml_int.h ('k') | core/src/fxge/agg/agg23/fx_agg_path_storage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/agg/agg23/agg_array.h
diff --git a/core/src/fxge/agg/agg23/agg_array.h b/core/src/fxge/agg/agg23/agg_array.h
index 810eb4ef22829241fefe9d5c9735f91044c1257f..b3b5f2b877c84e08a37985aaeaeb55009bf56786 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>
« no previous file with comments | « core/src/fxcrt/xml_int.h ('k') | core/src/fxge/agg/agg23/fx_agg_path_storage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698