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

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

Issue 361553002: Remove "this==NULL" and adjust corresponding callers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix if check warning Created 6 years, 6 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_decode.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
index 6b2483eda7e63a6e373d51ec92aba96662eee319..5854d71344451799125ec8c2164dba2a5ef7ece6 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
@@ -45,7 +45,7 @@ FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b
return (FX_DWORD) - 1;
}
int state = 0;
- FX_UINT32 res = 0;
+ FX_UINT32 res = 0;
pos = dest_size = 0;
while (pos < src_size) {
FX_BYTE ch = src_buf[pos++];
@@ -281,11 +281,11 @@ FX_BOOL PDF_DataDecode(FX_LPCBYTE src_buf, FX_DWORD src_size, const CPDF_Diction
CPDF_Dictionary*& pImageParms, FX_DWORD last_estimated_size, FX_BOOL bImageAcc)
{
- CPDF_Object* pDecoder = pDict->GetElementValue(FX_BSTRC("Filter"));
+ CPDF_Object* pDecoder = pDict ? pDict->GetElementValue(FX_BSTRC("Filter")) : NULL;
if (pDecoder == NULL || (pDecoder->GetType() != PDFOBJ_ARRAY && pDecoder->GetType() != PDFOBJ_NAME)) {
return FALSE;
}
- CPDF_Object* pParams = pDict->GetElementValue(FX_BSTRC("DecodeParms"));
+ CPDF_Object* pParams = pDict ? pDict->GetElementValue(FX_BSTRC("DecodeParms")) : NULL;
CFX_ByteStringArray DecoderList;
CFX_PtrArray ParamList;
if (pDecoder->GetType() == PDFOBJ_ARRAY) {
@@ -304,7 +304,7 @@ FX_BOOL PDF_DataDecode(FX_LPCBYTE src_buf, FX_DWORD src_size, const CPDF_Diction
}
} else {
DecoderList.Add(pDecoder->GetConstString());
- ParamList.Add(pParams->GetDict());
+ ParamList.Add(pParams ? pParams->GetDict() : NULL);
}
FX_LPBYTE last_buf = (FX_LPBYTE)src_buf;
FX_DWORD last_size = src_size;
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698