Index: dm/DMSrcSink.cpp |
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp |
index c89ffd1b7121839f880edf9a0fdab803dffe9881..4598a4894b7956ed681d6b199b569ee58572bf12 100644 |
--- a/dm/DMSrcSink.cpp |
+++ b/dm/DMSrcSink.cpp |
@@ -331,15 +331,16 @@ Error CodecSrc::draw(SkCanvas* canvas) const { |
} |
// Skip a stripe |
- const int linesToSkip = SkTMax(0, SkTMin(stripeHeight, |
- height - (i + 1) * stripeHeight)); |
- result = decoder->skipScanlines(linesToSkip); |
- switch (result) { |
- case SkImageGenerator::kSuccess: |
- case SkImageGenerator::kIncompleteInput: |
- break; |
- default: |
- return SkStringPrintf("Cannot skip scanlines for %s.", fPath.c_str()); |
+ const int linesToSkip = SkTMin(stripeHeight, height - (i + 1) * stripeHeight); |
+ if (linesToSkip > 0) { |
+ result = decoder->skipScanlines(linesToSkip); |
+ switch (result) { |
+ case SkImageGenerator::kSuccess: |
+ case SkImageGenerator::kIncompleteInput: |
+ break; |
+ default: |
+ return SkStringPrintf("Cannot skip scanlines for %s.", fPath.c_str()); |
+ } |
} |
} |
canvas->drawBitmap(bitmap, 0, 0); |