diff options
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r-- | core/fpdfapi/parser/cpdf_syntax_parser.cpp | 15 | ||||
-rw-r--r-- | core/fpdfapi/parser/fpdf_parser_decode.h | 1 | ||||
-rw-r--r-- | core/fpdfapi/parser/fpdf_parser_utility.cpp | 4 |
3 files changed, 7 insertions, 13 deletions
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index 624bde4ab3..8b8e59fa96 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp @@ -420,23 +420,22 @@ std::unique_ptr<CPDF_Object> CPDF_SyntaxParser::GetObjectBodyInternal( std::unique_ptr<CPDF_Dictionary> pDict = pdfium::MakeUnique<CPDF_Dictionary>(m_pPool); while (1) { - ByteString key = GetNextWord(nullptr); - if (key.IsEmpty()) + ByteString word = GetNextWord(nullptr); + if (word.IsEmpty()) return nullptr; - FX_FILESIZE SavedPos = m_Pos - key.GetLength(); - if (key == ">>") + FX_FILESIZE SavedPos = m_Pos - word.GetLength(); + if (word == ">>") break; - if (key == "endobj") { + if (word == "endobj") { m_Pos = SavedPos; break; } - if (key[0] != '/') + if (word[0] != '/') continue; - key = PDF_NameDecode(key); - + ByteString key = PDF_NameDecode(word.AsStringView()); if (key.IsEmpty() && parse_type == ParseType::kLoose) continue; diff --git a/core/fpdfapi/parser/fpdf_parser_decode.h b/core/fpdfapi/parser/fpdf_parser_decode.h index 6650b68c06..ab819c4832 100644 --- a/core/fpdfapi/parser/fpdf_parser_decode.h +++ b/core/fpdfapi/parser/fpdf_parser_decode.h @@ -18,7 +18,6 @@ class CPDF_Dictionary; extern const uint16_t PDFDocEncoding[256]; ByteString PDF_NameDecode(const ByteStringView& orig); -ByteString PDF_NameDecode(const ByteString& orig); ByteString PDF_NameEncode(const ByteString& orig); ByteString PDF_EncodeString(const ByteString& src, bool bHex); WideString PDF_DecodeText(const uint8_t* pData, uint32_t size); diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp index 45284a4ceb..c486a76706 100644 --- a/core/fpdfapi/parser/fpdf_parser_utility.cpp +++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp @@ -110,10 +110,6 @@ ByteString PDF_NameDecode(const ByteStringView& bstr) { return result; } -ByteString PDF_NameDecode(const ByteString& orig) { - return orig.Contains("#") ? PDF_NameDecode(orig.AsStringView()) : orig; -} - ByteString PDF_NameEncode(const ByteString& orig) { uint8_t* src_buf = (uint8_t*)orig.c_str(); int src_len = orig.GetLength(); |