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

Unified Diff: src/codec/SkSwizzler.cpp

Issue 1010903003: Add scanline decoding to SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cleanups Created 5 years, 9 months 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: src/codec/SkSwizzler.cpp
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp
index 563933f13a03c16e880c2b8132c7df3657fc4868..8fa3fd4b1bbc1a50edabcbe63ceb972f84978148 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -136,7 +136,7 @@ static bool swizzle_rgba_to_n32_unpremul_skipZ(void* SK_RESTRICT dstRow,
SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc, const SkPMColor* ctable,
const SkImageInfo& info, void* dst,
size_t dstRowBytes, bool skipZeroes) {
- if (info.colorType() == kUnknown_SkColorType) {
+ if (info.colorType() == kUnknown_SkColorType || kUnknown == sc) {
return NULL;
}
if (info.minRowBytes() > dstRowBytes) {
@@ -213,6 +213,7 @@ SkSwizzler::SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcBpp,
bool SkSwizzler::next(const uint8_t* SK_RESTRICT src) {
SkASSERT(fCurrY < fDstInfo.height());
+ SkASSERT(fDstRow != NULL);
const bool hadAlpha = fRowProc(fDstRow, src, fDstInfo.width(), fSrcPixelSize,
fCurrY, fColorTable);
fCurrY++;

Powered by Google App Engine
This is Rietveld 408576698