From 9fc53624a09f6d3378b0a540832571dc1c31fbcd Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Wed, 3 Jan 2018 15:35:33 -0500 Subject: check for irect with overflow width/height Bug:798066 Change-Id: Iac324ac5a32fae241a528751c84279ce60ac4baf Reviewed-on: https://skia-review.googlesource.com/90544 Reviewed-by: Mike Klein Commit-Queue: Mike Reed --- tests/AAClipTest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/AAClipTest.cpp') diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp index 5b156a40b5..18cc30c745 100644 --- a/tests/AAClipTest.cpp +++ b/tests/AAClipTest.cpp @@ -409,6 +409,15 @@ static void test_crbug_422693(skiatest::Reporter* reporter) { rc.op(path, SkMatrix::I(), rc.getBounds(), SkRegion::kIntersect_Op, true); } +static void test_huge(skiatest::Reporter* reporter) { + SkAAClip clip; + int big = 0x70000000; + SkIRect r = { -big, -big, big, big }; + SkASSERT(r.width() < 0 && r.height() < 0); + + clip.setRect(r); +} + DEF_TEST(AAClip, reporter) { test_empty(reporter); test_path_bounds(reporter); @@ -419,4 +428,5 @@ DEF_TEST(AAClip, reporter) { test_nearly_integral(reporter); test_really_a_rect(reporter); test_crbug_422693(reporter); + test_huge(reporter); } -- cgit v1.2.3