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

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp

Issue 1135893008: Re-land: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
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
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
index 3eac5ae74e53f6c0bba13faff8855469acd1a6c8..341be13d44a906e666a5c9e77c487ec18385144e 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;
}
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698