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

Unified Diff: core/fpdfapi/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: fix an undefined variable Created 4 years, 1 month 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/parser/fpdf_parser_utility.cpp
diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp
index 630754a23b4ce3607486d5998fffba0a002f05b1..caee3355feaedeb03f63bd9ca42408cdc6054688 100644
--- a/core/fpdfapi/parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp
@@ -72,10 +72,10 @@ int32_t GetHeaderOffset(IFX_SeekableReadStream* 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)
return -1;
- if (memcmp(buf, "%PDF", 4) == 0)
+ if (memcmp(buf, "%PDF", kBufSize) == 0)
return offset;
}
return -1;

Powered by Google App Engine
This is Rietveld 408576698