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

Unified Diff: core/fpdfapi/parser/cpdf_parser.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/cpdf_parser.cpp
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index ed20cf73f4f43ce2dd9aa8d12c68486e109ea813..4a6c0169b3c44554b490e322bec701e4d6931dc1 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -598,9 +598,11 @@ bool CPDF_Parser::RebuildCrossRef() {
bool bOverFlow = false;
uint32_t size =
std::min((uint32_t)(m_pSyntax->m_FileLen - pos), kBufferSize);
- if (!m_pSyntax->m_pFileAccess->ReadBlock(buffer.data(), pos, size))
+ uint32_t readSize =
+ m_pSyntax->m_pFileAccess->ReadBlock(buffer.data(), pos, size);
+ if (readSize != size && !m_pSyntax->m_pFileAccess->IsEOF())
break;
-
+ size = readSize;
for (uint32_t i = 0; i < size; i++) {
uint8_t byte = buffer[i];
switch (state) {

Powered by Google App Engine
This is Rietveld 408576698