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

Unified Diff: src/codec/SkSampledCodec.cpp

Issue 1417993006: Fix bug in sampled decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698