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

Unified Diff: core/src/fxcrt/fx_basic_buffer.cpp

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/fxcrt/fx_basic_bstring.cpp ('k') | core/src/fxcrt/fx_basic_maps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_basic_buffer.cpp
diff --git a/core/src/fxcrt/fx_basic_buffer.cpp b/core/src/fxcrt/fx_basic_buffer.cpp
index 7903740e4750e0e281e2a1636d68fe7dcde1b50f..06ba9413a55d1ef26013b5684d7e19e282f49857 100644
--- a/core/src/fxcrt/fx_basic_buffer.cpp
+++ b/core/src/fxcrt/fx_basic_buffer.cpp
@@ -88,10 +88,8 @@ void CFX_BinaryBuf::ExpandBuf(FX_STRSIZE add_size)
} else {
pNewBuffer = FX_Alloc(FX_BYTE, new_size);
}
- if (pNewBuffer) {
- m_pBuffer = pNewBuffer;
- m_AllocSize = new_size;
- }
+ m_pBuffer = pNewBuffer;
+ m_AllocSize = new_size;
}
void CFX_BinaryBuf::CopyData(const void* pStr, FX_STRSIZE size)
{
@@ -456,9 +454,6 @@ FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
}
if (!m_pBuffer) {
m_pBuffer = FX_Alloc(FX_BYTE, m_BufSize);
- if (!m_pBuffer) {
- return -1;
- }
}
FX_LPBYTE buffer = (FX_LPBYTE)pBuf;
FX_STRSIZE temp_size = (FX_STRSIZE)size;
« no previous file with comments | « core/src/fxcrt/fx_basic_bstring.cpp ('k') | core/src/fxcrt/fx_basic_maps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698