diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-05-20 09:50:37 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-05-20 09:50:37 -0700 |
commit | d50b172a9d3a05704748f0798b5aaa422485abbd (patch) | |
tree | 0289d99b370b8526c539fc676004bf622f5228a3 /core/src/fpdfapi/fpdf_parser | |
parent | 90a4181194dd8eca153cf2a101ec27e382b27a58 (diff) | |
download | pdfium-d50b172a9d3a05704748f0798b5aaa422485abbd.tar.xz |
Merge to XFA: Remove FX_Alloc() null checks now that it can't return NULL.
Original Review URL: https://codereview.chromium.org/1142713005
R=thestig@chromium.org
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1143663008
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp | 6 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp | 5 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 3 |
3 files changed, 1 insertions, 13 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp index 8f5871df7f..691981cb10 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp @@ -40,9 +40,6 @@ FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b return (FX_DWORD) - 1; } dest_buf = FX_Alloc(FX_BYTE, zcount * 4 + (pos - zcount)); - if (dest_buf == NULL) { - return (FX_DWORD) - 1; - } int state = 0; FX_UINT32 res = 0; pos = dest_size = 0; @@ -153,9 +150,6 @@ FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& d return -1; } dest_buf = FX_Alloc( FX_BYTE, dest_size); - if (!dest_buf) { - return -1; - } i = 0; int dest_count = 0; while (i < src_size) { diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp index 008349c61c..d75d6f5fba 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp @@ -1087,7 +1087,7 @@ void CPDF_StreamAcc::LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess, } if (!pStream->IsMemoryBased()) { pSrcData = m_pSrcData = FX_Alloc(FX_BYTE, dwSrcSize); - if (!pSrcData || !pStream->ReadRawData(0, pSrcData, dwSrcSize)) { + if (!pStream->ReadRawData(0, pSrcData, dwSrcSize)) { return; } } else { @@ -1166,9 +1166,6 @@ FX_LPBYTE CPDF_StreamAcc::DetachData() return p; } FX_LPBYTE p = FX_Alloc(FX_BYTE, m_dwSize); - if (p == NULL) { - return NULL; - } FXSYS_memcpy32(p, m_pData, m_dwSize); return p; } diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index 39e2d217b7..f1b316a0d6 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -2481,9 +2481,6 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT } CPDF_Stream* pStream; FX_LPBYTE pData = FX_Alloc(FX_BYTE, len); - if (!pData) { - return NULL; - } ReadBlock(pData, len); if (pCryptoHandler) { CFX_BinaryBuf dest_buf; |