summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-09-08 10:36:54 -0700
committerLei Zhang <thestig@chromium.org>2015-09-08 10:36:54 -0700
commite61b6e58c9c535ca097b9819c333b65825e0c64e (patch)
tree559a64b3a64ec4b0d1d151b85e37d6bfdf18edf1 /core
parente262c9af51c9227acb0966d7b8d29564600e15df (diff)
downloadpdfium-e61b6e58c9c535ca097b9819c333b65825e0c64e.tar.xz
Merge to XFA: Remove unneeded checks for CPDF_Object::GetDict() return values.
CPDF_Object::GetDict() always returns a valid pointer for dictionaries. R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1317733007 . (cherry picked from commit 2f740a8bd61c1c198796dd5e2124d007267f9c1a) Review URL: https://codereview.chromium.org/1323263006 .
Diffstat (limited to 'core')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index a101de76c0..4c2bb346a1 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -4118,13 +4118,11 @@ FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) {
return FALSE;
}
CPDF_Dictionary* pTrailerDict = pTrailer->GetDict();
- if (pTrailerDict) {
- CPDF_Object* pEncrypt = pTrailerDict->GetElement("Encrypt");
- if (pEncrypt && pEncrypt->GetType() == PDFOBJ_REFERENCE) {
- m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- pTrailer->Release();
- return TRUE;
- }
+ CPDF_Object* pEncrypt = pTrailerDict->GetElement("Encrypt");
+ if (pEncrypt && pEncrypt->GetType() == PDFOBJ_REFERENCE) {
+ m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
+ pTrailer->Release();
+ return TRUE;
}
FX_DWORD xrefpos = GetDirectInteger(pTrailer->GetDict(), FX_BSTRC("Prev"));
if (xrefpos) {
@@ -4241,8 +4239,7 @@ FX_BOOL CPDF_DataAvail::CheckUnkownPageNode(FX_DWORD dwPageNo,
}
pPageNode->m_dwPageNo = dwPageNo;
CPDF_Dictionary* pDict = pPage->GetDict();
- CFX_ByteString type =
- pDict ? pDict->GetString(FX_BSTRC("Type")) : CFX_ByteString();
+ CFX_ByteString type = pDict->GetString(FX_BSTRC("Type"));
if (type == FX_BSTRC("Pages")) {
pPageNode->m_type = PDF_PAGENODE_PAGES;
CPDF_Object* pKids = pDict->GetElement(FX_BSTRC("Kids"));