Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: src/codec/SkBmpCodec.cpp

Issue 1704063002: Do not create BmpMaskCodecs with invalid bits per pixel (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkBmpCodec.cpp
diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp
index babb17d32e5902dab1c73c558f9c8247bd18f94e..5616a650a6de0ab75e6fb2789f47eff15b2f3f71 100644
--- a/src/codec/SkBmpCodec.cpp
+++ b/src/codec/SkBmpCodec.cpp
@@ -432,6 +432,12 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698