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

Unified Diff: core/fpdfapi/edit/fpdf_edit_create.cpp

Issue 2430743003: in the attempt to fix 627393, changed IFX_FileRead's readBlock to return the length it reads
Patch Set: delete the include folder 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
« no previous file with comments | « no previous file | core/fpdfapi/parser/cpdf_data_avail.cpp » ('j') | core/fpdfapi/parser/cpdf_data_avail.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/edit/fpdf_edit_create.cpp
diff --git a/core/fpdfapi/edit/fpdf_edit_create.cpp b/core/fpdfapi/edit/fpdf_edit_create.cpp
index a578a0a1141c81f80a64634c54c098b7ae428fed..7689ba7cb8381a0b86dfac1b4e22b0af68c318a0 100644
--- a/core/fpdfapi/edit/fpdf_edit_create.cpp
+++ b/core/fpdfapi/edit/fpdf_edit_create.cpp
@@ -1494,7 +1494,9 @@ int32_t CPDF_Creator::WriteDoc_Stage1(IFX_Pause* pPause) {
uint32_t src_size = (uint32_t)(uintptr_t)m_Pos;
while (src_size) {
uint32_t block_size = src_size > 4096 ? 4096 : src_size;
- if (!pSrcFile->ReadBlock(buffer, m_Offset - src_size, block_size)) {
+ if (pSrcFile->ReadBlock(buffer, m_Offset - src_size, block_size) !=
+ block_size &&
+ !pSrcFile->IsEOF()) {
return -1;
}
if (m_File.AppendBlock(buffer, block_size) < 0) {
Tom Sepez 2016/11/14 20:27:40 we could have a short read here, yet we appended t
« no previous file with comments | « no previous file | core/fpdfapi/parser/cpdf_data_avail.cpp » ('j') | core/fpdfapi/parser/cpdf_data_avail.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698