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

Unified Diff: core/include/fxcrt/fx_basic.h

Issue 1136673005: Merge to XFA: Add safe FX_Alloc2D() macro (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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 | « no previous file | core/include/fxcrt/fx_memory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxcrt/fx_basic.h
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index de80ea7f7a84570dfe7b8e81cfc14b9dddc5b514..7c25b237ad6e68bcc8144320479995e86765fec0 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -1463,10 +1463,7 @@ public:
while (nCount > 0) {
FX_INT32 temp_count = FX_MIN(nCount, FX_DATALIST_LENGTH);
DataList list;
- list.data = FX_Alloc(FX_BYTE, temp_count * unit);
- if (!list.data) {
- break;
- }
+ list.data = FX_Alloc2D(FX_BYTE, temp_count, unit);
list.start = nStart;
list.count = temp_count;
Append(list);
« no previous file with comments | « no previous file | core/include/fxcrt/fx_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698