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

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: 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/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 c4c745587f31fd7fa3b215f49e3a17f360000746..952fbdfae0ee1615d6e10f3e3b1a431d3ee9469c 100644
--- a/core/fxcodec/codec/fx_codec_tiff.cpp
+++ b/core/fxcodec/codec/fx_codec_tiff.cpp
@@ -98,11 +98,14 @@ tsize_t tiff_read(thandle_t context, tdata_t buf, tsize_t length) {
if (!increment.IsValid())
return 0;
- 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->set_offset(increment.ValueOrDie());
- return length;
+ pTiffContext->set_offset(increment.ValueOrDie() - length + 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