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;