summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_parser
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-05-19 15:19:32 -0700
committerTom Sepez <tsepez@chromium.org>2015-05-19 15:19:32 -0700
commit981a3468319eb24e696bb64ba84d9631fd26f1f7 (patch)
treec1136b807975ccc80199ff6593e69475261c1670 /core/src/fpdfapi/fpdf_parser
parentbf4aa2cc93a67826247e887b2ba26a1b965eb616 (diff)
downloadpdfium-981a3468319eb24e696bb64ba84d9631fd26f1f7.tar.xz
Re-land: Remove FX_Alloc() null checks now that it can't return NULL.
Fixes the ordering of some assignments broken when converting to checked numerics in CFX_PathData::AddPointCount(). Original Review URL: https://codereview.chromium.org/1142713005 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1135893008
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp5
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp3
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 3eac5ae74e..341be13d44 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -1086,7 +1086,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 {
@@ -1165,9 +1165,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 2772d9825e..0d4ed27c06 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -2477,9 +2477,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;