From 1170a553be35920fe45d6a454a27d21167060977 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Fri, 8 Sep 2017 15:00:25 -0400 Subject: Don't allow iteration through non-finite points. Added a unit test too. BUG=chromium:756563 Change-Id: Ic77a89b4a98d1a553877af9807a3d3bdcd077bb9 Reviewed-on: https://skia-review.googlesource.com/44420 Commit-Queue: Mike Klein Reviewed-by: Mike Reed --- tests/PathTest.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/PathTest.cpp') diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index bdd15fbfb3..77f47bed30 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -4911,3 +4911,18 @@ DEF_TEST(PathRefSerialization, reporter) { REPORTER_ASSERT(reporter, !bytesRead); } } + +DEF_TEST(NonFinitePathIteration, reporter) { + SkPath path; + path.moveTo(SK_ScalarInfinity, SK_ScalarInfinity); + + int verbs = 0; + + SkPath::RawIter iter(path); + SkPoint pts[4]; + while (iter.next(pts) != SkPath::kDone_Verb) { + verbs++; + } + + REPORTER_ASSERT(reporter, verbs == 0); +} -- cgit v1.2.3