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

Unified Diff: core/src/fxcrt/extension.h

Issue 1142713005: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix missing FX_Alloc2D, check overflow on add, remove unused enum. 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/fxcodec/codec/fx_codec_jpx_opj.cpp ('k') | core/src/fxcrt/fx_basic_array.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/extension.h
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index dbee7e676a2c9ab9bcc88cbbfe52302cc42f074c..c459bdcf99609e37ba11c3c2fff4dcf30808b44d 100644
--- a/core/src/fxcrt/extension.h
+++ b/core/src/fxcrt/extension.h
@@ -348,9 +348,7 @@ public:
if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
if (m_Blocks.GetSize() < 1) {
FX_LPBYTE pBlock = FX_Alloc(FX_BYTE, FX_MAX(nInitSize, 4096));
- if (pBlock) {
- m_Blocks.Add(pBlock);
- }
+ m_Blocks.Add(pBlock);
}
m_nGrowSize = FX_MAX(nGrowSize, 4096);
} else if (m_Blocks.GetSize() < 1) {
@@ -407,9 +405,6 @@ protected:
m_Blocks.SetSize(m_Blocks.GetSize() + (FX_INT32)size);
while (size --) {
FX_LPBYTE pBlock = FX_Alloc(FX_BYTE, m_nGrowSize);
- if (!pBlock) {
- return FALSE;
- }
m_Blocks.SetAt(iCount ++, pBlock);
m_nTotalSize += m_nGrowSize;
}
« no previous file with comments | « core/src/fxcodec/codec/fx_codec_jpx_opj.cpp ('k') | core/src/fxcrt/fx_basic_array.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698