encodedProfile can be null, so check for that

Bug: b/116608007
Change-Id: I622165d5c63f3a8548e763899128b3eb4b8459a6
Reviewed-on: https://skia-review.googlesource.com/157420
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
Leon Scroggins III 2018-09-27 08:30:22 -04:00 committed by Skia Commit-Bot
parent b3e48afc93
commit 227d4e1027

View File

@ -177,15 +177,17 @@ sk_sp<SkColorSpace> SkAndroidCodec::computeOutputColorSpace(SkColorType outputCo
} }
const skcms_ICCProfile* encodedProfile = fCodec->getEncodedInfo().profile(); const skcms_ICCProfile* encodedProfile = fCodec->getEncodedInfo().profile();
if (auto encodedSpace = SkColorSpace::Make(*encodedProfile)) { if (encodedProfile) {
// Leave the pixels in the encoded color space. Color space conversion if (auto encodedSpace = SkColorSpace::Make(*encodedProfile)) {
// will be handled after decode time. // Leave the pixels in the encoded color space. Color space conversion
return encodedSpace; // will be handled after decode time.
} return encodedSpace;
}
if (is_wide_gamut(*encodedProfile)) { if (is_wide_gamut(*encodedProfile)) {
return SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma, return SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma,
SkColorSpace::kDCIP3_D65_Gamut); SkColorSpace::kDCIP3_D65_Gamut);
}
} }
return SkColorSpace::MakeSRGB(); return SkColorSpace::MakeSRGB();