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

Unified Diff: core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp

Issue 2430743003: in the attempt to fix 627393, changed IFX_FileRead's readBlock to return the length it reads
Patch Set: remove .tmp files Created 4 years, 2 months 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
Index: core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index a9f20a9093b0402580d0b14353fadcec1b591577..0c16ba52bb0e259fcb8ce8fdbf1f04dd0e13c7dd 100644
--- a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -72,7 +72,7 @@ int32_t GetHeaderOffset(IFX_FileRead* pFile) {
const size_t kBufSize = 4;
uint8_t buf[kBufSize];
for (int32_t offset = 0; offset <= 1024; ++offset) {
- if (!pFile->ReadBlock(buf, offset, kBufSize))
+ if (pFile->ReadBlock(buf, offset, kBufSize) != kBufSize && !pFile->IsEOF())
return -1;
if (memcmp(buf, "%PDF", 4) == 0)

Powered by Google App Engine
This is Rietveld 408576698