Index: src/codec/SkPngCodec.cpp |
diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp |
index 84d25752250c0bc37b40cca9f39df2f9dfa73817..43d1580c176b0b0cfff9b3fda103fd6627f0b765 100644 |
--- a/src/codec/SkPngCodec.cpp |
+++ b/src/codec/SkPngCodec.cpp |
@@ -608,6 +608,11 @@ static bool read_header(SkStream* stream, SkPngChunkReader* chunkReader, SkCodec |
if (outCodec) { |
sk_sp<SkColorSpace> colorSpace = read_color_space(png_ptr, info_ptr); |
+ if (!colorSpace) { |
+ // Treat unmarked pngs as sRGB. |
+ colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
+ } |
+ |
SkEncodedInfo info = SkEncodedInfo::Make(color, alpha, 8); |
if (1 == numberPasses) { |