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

Unified Diff: src/codec/SkCodec_wbmp.cpp

Issue 1277253003: Update CodexTest to test valid_alpha. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Test opaque to not, plus conversion check in wbmp Created 5 years, 4 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 | tests/CodexTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_wbmp.cpp
diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp
index 86dce5cc89e95590f8d0d138df9bda352994f95d..69ef7d4091d0aa3f6f3c514185c0cc2ca70277e8 100644
--- a/src/codec/SkCodec_wbmp.cpp
+++ b/src/codec/SkCodec_wbmp.cpp
@@ -128,6 +128,10 @@ SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info,
return kInvalidScale;
}
+ if (!valid_alpha(info.alphaType(), this->getInfo().alphaType())) {
+ return SkCodec::kInvalidConversion;
+ }
+
// Prepare a color table if necessary
setup_color_table(info.colorType(), ctable, ctableCount);
@@ -208,6 +212,10 @@ public:
return SkCodec::kInvalidScale;
}
+ if (!valid_alpha(dstInfo.alphaType(), this->getInfo().alphaType())) {
+ return SkCodec::kInvalidConversion;
+ }
+
// Fill in the color table
setup_color_table(dstInfo.colorType(), inputColorTable, inputColorCount);
« no previous file with comments | « no previous file | tests/CodexTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698