summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-01-24 21:57:40 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-24 21:57:40 +0000
commit6daeb04d3f61378d46d2543573d87e587dd9e544 (patch)
treed146f1108a3525770e7948771b284a3a9b969060 /core/fpdfapi
parent97bd5e3a6fb0ace00015685ea4246cd2c478c685 (diff)
downloadpdfium-6daeb04d3f61378d46d2543573d87e587dd9e544.tar.xz
Fix some nits in CPDF_Parser.
Change-Id: Ib4c6589a63761e8993e8cd33ed9459ba3d1e206c Reviewed-on: https://pdfium-review.googlesource.com/23911 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index 0d1b02a5ce..d8ac8c97b3 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -35,6 +35,7 @@ namespace {
// this may be large enough in practice.
const int32_t kMaxXRefSize = 1048576;
+// "%PDF-1.7\n"
constexpr FX_FILESIZE kPDFHeaderSize = 9;
uint32_t GetVarInt(const uint8_t* p, int32_t n) {
@@ -167,7 +168,7 @@ bool CPDF_Parser::IsObjectFreeOrNull(uint32_t objnum) const {
case ObjectType::kCompressed:
return false;
}
- ASSERT(false); // NOTREACHED();
+ NOTREACHED();
return false;
}
@@ -395,7 +396,7 @@ bool CPDF_Parser::VerifyCrossRefV4() {
// something is wrong with the cross reference table.
return false;
}
- return true;
+ break;
}
return true;
}
@@ -637,15 +638,13 @@ bool CPDF_Parser::ParseCrossRefV4(std::vector<CrossRefObjData>* out_objects) {
return true;
}
-bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos,
- bool bSkip) {
+bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, bool bSkip) {
m_pSyntax->SetPos(pos);
std::vector<CrossRefObjData> objects;
if (!ParseCrossRefV4(bSkip ? nullptr : &objects))
return false;
MergeCrossRefObjectsData(objects);
-
return true;
}
@@ -1077,7 +1076,7 @@ bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE* pos, bool bMainXRef) {
}
}
- if (arrIndex.size() == 0)
+ if (arrIndex.empty())
arrIndex.push_back(std::make_pair(0, size));
pArray = pDict->GetArrayFor("W");