Index: tests/ImageDecodingTest.cpp |
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp |
index 2e0225a26195bdcaf1d39a9c143f6818ea53f349..81f900660d6d5b259fcf261ad8ffb4ca024efa6e 100644 |
--- a/tests/ImageDecodingTest.cpp |
+++ b/tests/ImageDecodingTest.cpp |
@@ -333,7 +333,10 @@ static SkPixelRef* install_pixel_ref(SkBitmap* bitmap, |
SkASSERT(stream != NULL); |
SkASSERT(stream->rewind()); |
SkASSERT(stream->unique()); |
- SkColorType colorType = bitmap->colorType(); |
+ SkColorType colorType; |
+ if (!SkBitmapConfigToColorType(bitmap->config(), &colorType)) { |
+ return NULL; |
+ } |
SkDecodingImageGenerator::Options opts(sampleSize, ditherImage, colorType); |
SkAutoTDelete<SkImageGenerator> gen( |
SkDecodingImageGenerator::Create(stream, opts)); |