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

Unified Diff: tests/ColorSpaceTest.cpp

Issue 2257983003: Add checks for bogus profiles to SkColorSpace::NewICC() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Relax constraints Created 4 years, 2 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 | « src/core/SkColorSpace_ICC.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ColorSpaceTest.cpp
diff --git a/tests/ColorSpaceTest.cpp b/tests/ColorSpaceTest.cpp
index e9cc14ff45bf65d8db002c9d56955b3cd05209e7..680193e7189c2b8cc7898139768480b1b7f42ac0 100644
--- a/tests/ColorSpaceTest.cpp
+++ b/tests/ColorSpaceTest.cpp
@@ -313,3 +313,11 @@ DEF_TEST(ColorSpace_Primaries, r) {
sk_sp<SkColorSpace> space = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma, toXYZ);
REPORTER_ASSERT(r, SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) == space);
}
+
+DEF_TEST(ColorSpace_Size, r) {
+ int memory[30];
+
+ // NewICC() should fail immediately because the size of the input profile is larger than
+ // the max size allowed.
+ REPORTER_ASSERT(r, !SkColorSpace::NewICC(memory, (2 << 22) + 1));
+}
« no previous file with comments | « src/core/SkColorSpace_ICC.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698