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

Unified Diff: xfa/fgas/font/fgas_stdfontmgr.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/fgas/font/fgas_stdfontmgr.cpp
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
index d4907bb91980d80805bab6fd1149383cddf5eafa..8ca58492a911abf078c5729a7025c364db97d89c 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.cpp
+++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
@@ -869,9 +869,10 @@ unsigned long _ftStreamRead(FXFT_Stream stream,
IFX_SeekableReadStream* pFile =
(IFX_SeekableReadStream*)stream->descriptor.pointer;
- int res = pFile->ReadBlock(buffer, offset, count);
- if (res)
- return count;
+ unsigned long readSize =
+ static_cast<unsigned long>(pFile->ReadBlock(buffer, offset, count));
+ if (readSize == count || pFile->IsEOF())
+ return readSize;
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698