diff options
author | msarett <msarett@google.com> | 2016-05-04 13:03:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-04 13:03:48 -0700 |
commit | 3e375b0a51a46814cf08ecd1a513862006a704e5 (patch) | |
tree | b3cdfbd65951301fa0ec048303497e93825b7a01 /src/codec/SkBmpCodec.cpp | |
parent | 76948d4faaca9fd7730576e2f79790ca8d93c10b (diff) |
Fix ICO bug exposed by the fuzzer
BUG=skia:5248
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1949773002
Review-Url: https://codereview.chromium.org/1949773002
Diffstat (limited to 'src/codec/SkBmpCodec.cpp')
-rw-r--r-- | src/codec/SkBmpCodec.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp index 680436ab91..1c999eba3c 100644 --- a/src/codec/SkBmpCodec.cpp +++ b/src/codec/SkBmpCodec.cpp @@ -442,7 +442,9 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) { } break; case 24: - color = SkEncodedInfo::kBGR_Color; + // In the case of ICO, kBGRA is actually the closest match, + // since we will need to apply a transparency mask. + color = inIco ? SkEncodedInfo::kBGRA_Color : SkEncodedInfo::kBGR_Color; bitsPerComponent = 8; break; case 32: |