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

Unified Diff: xfa/fde/xml/cfx_saxreader.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: xfa/fde/xml/cfx_saxreader.cpp
diff --git a/xfa/fde/xml/cfx_saxreader.cpp b/xfa/fde/xml/cfx_saxreader.cpp
index b4d48d29379436c2db2e95a514cb7836fa4e8638..313f2d213a5f968f502c0ff993b34720ed3b2e5b 100644
--- a/xfa/fde/xml/cfx_saxreader.cpp
+++ b/xfa/fde/xml/cfx_saxreader.cpp
@@ -86,7 +86,8 @@ bool CFX_SAXFile::StartFile(IFX_SeekableReadStream* pFile,
}
m_dwBufSize = std::min(dwLen, kSaxFileBufSize);
m_pBuf = FX_Alloc(uint8_t, m_dwBufSize);
- if (!pFile->ReadBlock(m_pBuf, dwStart, m_dwBufSize)) {
+ if (pFile->ReadBlock(m_pBuf, dwStart, m_dwBufSize) != m_dwBufSize &&
+ !pFile->IsEOF()) {
return false;
}
m_dwStart = dwStart;
@@ -104,7 +105,8 @@ bool CFX_SAXFile::ReadNextBlock() {
return false;
}
m_dwBufSize = std::min(dwSize, kSaxFileBufSize);
- if (!m_pFile->ReadBlock(m_pBuf, m_dwCur, m_dwBufSize)) {
+ if (m_pFile->ReadBlock(m_pBuf, m_dwCur, m_dwBufSize) != m_dwBufSize &&
+ !m_pFile->IsEOF()) {
return false;
}
m_dwBufIndex = 0;

Powered by Google App Engine
This is Rietveld 408576698