aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkBmpCodec.cpp
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-05-04 13:03:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-04 13:03:48 -0700
commit3e375b0a51a46814cf08ecd1a513862006a704e5 (patch)
treeb3cdfbd65951301fa0ec048303497e93825b7a01 /src/codec/SkBmpCodec.cpp
parent76948d4faaca9fd7730576e2f79790ca8d93c10b (diff)
Fix ICO bug exposed by the fuzzer
Diffstat (limited to 'src/codec/SkBmpCodec.cpp')
-rw-r--r--src/codec/SkBmpCodec.cpp4
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: