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

Unified Diff: core/fpdfapi/parser/cpdf_stream.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_stream.cpp
diff --git a/core/fpdfapi/parser/cpdf_stream.cpp b/core/fpdfapi/parser/cpdf_stream.cpp
index 11ef1d2dc18cceed17dc1ceb115aed0715c73c40..9272522cd7aa922150cc9395aa3acf1fcc964c33 100644
--- a/core/fpdfapi/parser/cpdf_stream.cpp
+++ b/core/fpdfapi/parser/cpdf_stream.cpp
@@ -105,7 +105,7 @@ bool CPDF_Stream::ReadRawData(FX_FILESIZE offset,
uint8_t* buf,
uint32_t size) const {
if (m_bMemoryBased && m_pFile)
- return m_pFile->ReadBlock(buf, offset, size);
+ return m_pFile->ReadBlock(buf, offset, size) == size || m_pFile->IsEOF();
Tom Sepez 2016/11/16 18:32:00 This will return success if a short read at EOF.
if (m_pDataBuf)
FXSYS_memcpy(buf, m_pDataBuf.get() + offset, size);

Powered by Google App Engine
This is Rietveld 408576698