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

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: 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: xfa/fde/xml/cfx_saxreader.cpp
diff --git a/xfa/fde/xml/cfx_saxreader.cpp b/xfa/fde/xml/cfx_saxreader.cpp
index ec22c735416f8eacbb293b8ce58477639c275e75..b616516490de2837be80a4cd4797ddd2ba1ba289 100644
--- a/xfa/fde/xml/cfx_saxreader.cpp
+++ b/xfa/fde/xml/cfx_saxreader.cpp
@@ -84,7 +84,8 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* 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;
@@ -101,7 +102,8 @@ FX_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