Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
index b28bbf169b8bb4c1c9819569c14689ad7b586589..04aca910822152e77ad6b8b4d445464abd78de25 100644 |
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
@@ -2352,11 +2352,11 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, |
m_Pos += ReadEOLMarkers(m_Pos); |
FXSYS_memset(m_WordBuffer, 0, ENDSTREAM_LEN + 1); |
GetNextWord(); |
- if (FXSYS_memcmp(m_WordBuffer, "endstream", ENDSTREAM_LEN) == 0 && |
- IsWholeWord(m_Pos - ENDSTREAM_LEN, m_FileLen, |
- FX_BSTRC("endstream").GetPtr(), ENDSTREAM_LEN, TRUE)) { |
+ // Earlier version of PDF specification doesn't require EOL marker before |
+ // 'endstream' keyword. If keyword 'endstream' follows the bytes in |
+ // specified length, it signals the end of stream. |
+ if (FXSYS_memcmp(m_WordBuffer, "endstream", ENDSTREAM_LEN) == 0) |
bSearchForKeyword = FALSE; |
- } |
} |
if (bSearchForKeyword) { |
// If len is not available, len needs to be calculated |