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

Unified Diff: cc/output/filter_operations_unittest.cc

Issue 2593583005: cc: Prevent float-cast-overflow in MapRectInternal. (Closed)
Patch Set: . Created 4 years 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 | « cc/output/filter_operation.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/filter_operations_unittest.cc
diff --git a/cc/output/filter_operations_unittest.cc b/cc/output/filter_operations_unittest.cc
index 8a32e663d5447e6c6ec09462d3448927b4cfb0b6..fe86feb4efb87e126971e515c234173690a0671f 100644
--- a/cc/output/filter_operations_unittest.cc
+++ b/cc/output/filter_operations_unittest.cc
@@ -39,6 +39,14 @@ TEST(FilterOperationsTest, MapRectBlur) {
ops.MapRect(gfx::Rect(0, -10, 10, 10), SkMatrix::MakeScale(1, -1)));
}
+TEST(FilterOperationsTest, MapRectBlurOverflow) {
+ // Passes if float-cast-overflow does not occur in ubsan builds.
+ // The blur spread exceeds INT_MAX.
+ FilterOperations ops;
+ ops.Append(FilterOperation::CreateBlurFilter(2e9f));
+ ops.MapRect(gfx::Rect(0, 0, 10, 10), SkMatrix::I());
+}
+
TEST(FilterOperationsTest, MapRectReverseBlur) {
FilterOperations ops;
ops.Append(FilterOperation::CreateBlurFilter(20));
« no previous file with comments | « cc/output/filter_operation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698