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

Unified Diff: core/fxge/android/cfpf_skiafontmgr.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/fxge/android/cfpf_skiafontmgr.cpp
diff --git a/core/fxge/android/cfpf_skiafontmgr.cpp b/core/fxge/android/cfpf_skiafontmgr.cpp
index 6463e8b5311dafcc90656b02647c956f33b188e3..a336fef2aaf13428c2298bdde061b96a9dc4c9f6 100644
--- a/core/fxge/android/cfpf_skiafontmgr.cpp
+++ b/core/fxge/android/cfpf_skiafontmgr.cpp
@@ -33,10 +33,12 @@ static unsigned long FPF_SkiaStream_Read(FXFT_Stream stream,
if (!pFileRead)
return 0;
if (count > 0) {
- if (!pFileRead->ReadBlock(buffer, (FX_FILESIZE)offset, (size_t)count))
+ unsigned long readSize = static_cast<unsigned long>(
+ pFileRead->ReadBlock(buffer, (FX_FILESIZE)offset, (size_t)count));
+ if (readSize != count && !pFileRead->IsEOF()) {
return 0;
}
- return count;
+ return readSize;
Tom Sepez 2016/11/16 18:32:01 readSize has gone out of scope. Did this compile?
}
static void FPF_SkiaStream_Close(FXFT_Stream stream) {}

Powered by Google App Engine
This is Rietveld 408576698