summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-12-01 22:52:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-01 22:52:42 +0000
commitb8d86800487df4021860f08407c323ed82243c79 (patch)
treeac91e7e9405cf47594316623b26a0aadd9544e79 /core/fpdfapi/parser
parentdca380ffe0571be4023b11b06b8aecad9934bb06 (diff)
downloadpdfium-b8d86800487df4021860f08407c323ed82243c79.tar.xz
Get rid of else after break/continue/return.chromium/3284chromium/3283
Change-Id: I3efc57cd7325d16e3ca8ebdeeaec06012b2c56e3 Reviewed-on: https://pdfium-review.googlesource.com/20110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.cpp3
-rw-r--r--core/fpdfapi/parser/cpdf_syntax_parser.cpp7
-rw-r--r--core/fpdfapi/parser/fpdf_parser_decode.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index 5b57b949ba..4e77773a3b 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -394,9 +394,8 @@ bool CPDF_Parser::VerifyCrossRefV4() {
// If the object number read doesn't match the one stored,
// something is wrong with the cross reference table.
return false;
- } else {
- return true;
}
+ return true;
}
return true;
}
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
index ddf420b34a..66ce1838f2 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
@@ -208,6 +208,10 @@ ByteString CPDF_SyntaxParser::ReadString() {
break;
}
+ if (ch == '\r') {
+ status = ReadStatus::CarriageReturn;
+ break;
+ }
if (ch == 'n') {
buf << '\n';
} else if (ch == 'r') {
@@ -218,9 +222,6 @@ ByteString CPDF_SyntaxParser::ReadString() {
buf << '\b';
} else if (ch == 'f') {
buf << '\f';
- } else if (ch == '\r') {
- status = ReadStatus::CarriageReturn;
- break;
} else if (ch != '\n') {
buf << static_cast<char>(ch);
}
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.cpp b/core/fpdfapi/parser/fpdf_parser_decode.cpp
index 9532b8242d..3a8660f0a4 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_decode.cpp
@@ -361,6 +361,8 @@ bool PDF_DataDecode(const uint8_t* src_buf,
uint8_t* new_buf = nullptr;
uint32_t new_size = 0xFFFFFFFF;
int offset = -1;
+ if (decoder == "Crypt")
+ continue;
if (decoder == "FlateDecode" || decoder == "Fl") {
if (bImageAcc && i == nSize - 1) {
*ImageEncoding = "FlateDecode";
@@ -387,8 +389,6 @@ bool PDF_DataDecode(const uint8_t* src_buf,
return true;
}
offset = RunLengthDecode(last_buf, last_size, &new_buf, &new_size);
- } else if (decoder == "Crypt") {
- continue;
} else {
// If we get here, assume it's an image decoder.
if (decoder == "DCT")