commit | d9ec32090e95cebc7c1bb7c4fe29bef54629ef2c | [log] [tgz] |
---|---|---|
author | msarett <msarett@google.com> | Wed Feb 17 11:26:55 2016 -0800 |
committer | Commit bot <commit-bot@chromium.org> | Wed Feb 17 11:26:56 2016 -0800 |
tree | 84a46f2659fba8fec0645cc936c647f6b5487b6c | |
parent | 6b3cf73af525fdbf6fd093304db840bb998e3dd6 [diff] [blame] |
Do not create BmpMaskCodecs with invalid bits per pixel BUG=skia:4962 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1704063002 Review URL: https://codereview.chromium.org/1704063002
diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp index babb17d..5616a65 100644 --- a/src/codec/SkBmpCodec.cpp +++ b/src/codec/SkBmpCodec.cpp
@@ -432,6 +432,12 @@ if (kRLE_BmpInputFormat != inputFormat && !inIco) { colorType = kIndex_8_SkColorType; } + + // Mask bmps must have 16, 24, or 32 bits per pixel. + if (kBitMask_BmpInputFormat == inputFormat) { + SkCodecPrintf("Error: invalid input value of bits per pixel for mask bmp.\n"); + return false; + } case 24: case 32: break;