aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ImageDecodingTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ImageDecodingTest.cpp')
-rw-r--r--tests/ImageDecodingTest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp
index 2e0225a261..81f900660d 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));