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

Unified Diff: core/fxcodec/codec/fx_codec_tiff.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: core/fxcodec/codec/fx_codec_tiff.cpp
diff --git a/core/fxcodec/codec/fx_codec_tiff.cpp b/core/fxcodec/codec/fx_codec_tiff.cpp
index 2a00bb2d2055f9d8f05292dc1d474f600cc405b6..4d9db8ba44571d8ce824dcb34c0c7ad8910eb581 100644
--- a/core/fxcodec/codec/fx_codec_tiff.cpp
+++ b/core/fxcodec/codec/fx_codec_tiff.cpp
@@ -90,11 +90,14 @@ namespace {
tsize_t tiff_read(thandle_t context, tdata_t buf, tsize_t length) {
CCodec_TiffContext* pTiffContext = (CCodec_TiffContext*)context;
- if (!pTiffContext->io_in()->ReadBlock(buf, pTiffContext->offset(), length))
+ size_t readSize =
+ pTiffContext->io_in()->ReadBlock(buf, pTiffContext->offset(), length);
+ if (readSize != static_cast<size_t>(length) &&
+ !pTiffContext->io_in()->IsEOF())
return 0;
- pTiffContext->increment_offset(length);
- return length;
+ pTiffContext->increment_offset(readSize);
+ return readSize;
}
tsize_t tiff_write(thandle_t context, tdata_t buf, tsize_t length) {

Powered by Google App Engine
This is Rietveld 408576698