Index: src/codec/SkSampledCodec.cpp |
diff --git a/src/codec/SkSampledCodec.cpp b/src/codec/SkSampledCodec.cpp |
index 5302149e1212ba6a14d34e6a29878c24fdfc1d3f..d5fbd0fa520615a4a750674ea792bb199b7bdfb9 100644 |
--- a/src/codec/SkSampledCodec.cpp |
+++ b/src/codec/SkSampledCodec.cpp |
@@ -215,11 +215,12 @@ SkCodec::Result SkSampledCodec::sampledDecode(const SkImageInfo& info, void* pix |
dstHeight, y + 1); |
return SkCodec::kIncompleteInput; |
} |
- int linesToSkip = SkTMin(sampleY - 1, dstHeight - y - 1); |
msarett
2015/11/05 17:57:19
I think the intent here was to not skip past the e
|
- if (!fCodec->skipScanlines(linesToSkip)) { |
- fCodec->fillIncompleteImage(info, pixels, rowBytes, options.fZeroInitialized, |
- dstHeight, y + 1); |
- return SkCodec::kIncompleteInput; |
+ if (y < dstHeight - 1) { |
+ if (!fCodec->skipScanlines(sampleY - 1)) { |
+ fCodec->fillIncompleteImage(info, pixels, rowBytes, |
+ options.fZeroInitialized, dstHeight, y + 1); |
+ return SkCodec::kIncompleteInput; |
+ } |
} |
pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes); |
} |