diff options
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r-- | core/fpdfapi/parser/cpdf_parser.cpp | 3 | ||||
-rw-r--r-- | core/fpdfapi/parser/cpdf_syntax_parser.cpp | 7 | ||||
-rw-r--r-- | core/fpdfapi/parser/fpdf_parser_decode.cpp | 4 |
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") |