Index: src/codec/SkSampledCodec.cpp |
diff --git a/src/codec/SkSampledCodec.cpp b/src/codec/SkSampledCodec.cpp |
index 403b42f7107a8572dfa3ce1d9bc66af1ded3e1e5..cca26000d684bacaaa8bc52d1896daf66da4b0c0 100644 |
--- a/src/codec/SkSampledCodec.cpp |
+++ b/src/codec/SkSampledCodec.cpp |
@@ -257,10 +257,11 @@ SkCodec::Result SkSampledCodec::sampledDecode(const SkImageInfo& info, void* pix |
return SkCodec::kSuccess; |
} |
SkASSERT(incResult == SkCodec::kIncompleteInput); |
- const int lastRowInOutput = (rowsDecoded - startY) / sampleY; |
- // FIXME: Should this be info or nativeInfo? Does it make a difference? |
+ |
+ // Count the rows that we decoded, and also did not skip. |
+ const int trueRowsDecoded = (rowsDecoded + sampleY - 1) / sampleY; |
this->codec()->fillIncompleteImage(info, pixels, rowBytes, options.fZeroInitialized, |
- info.height(), lastRowInOutput); |
+ info.height(), trueRowsDecoded); |
return SkCodec::kIncompleteInput; |
} else if (startResult != SkCodec::kUnimplemented) { |
return startResult; |