Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 1499433002: fix for stream object reading (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | testing/resources/pixel/bug_551258_1.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d5664c29ab46c0dd09d090b776bea1c11094ffe9..14a87f85e6044fd4b260e17f29730ccef74c015c 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
« no previous file with comments | « no previous file | testing/resources/pixel/bug_551258_1.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698