If we lose precision computing sum of the dash intervals, then we can have the
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 6 Aug 2012 14:58:35 +0000 (14:58 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 6 Aug 2012 14:58:35 +0000 (14:58 +0000)
commitd9ee348720f933d8a23547ee36693880296810c5
treef69c3ac71aa10a182360c9c5b514e26da4e63da1
parent157d94465a47a57e30e5cf49cd57dccd903e27e2
If we lose precision computing sum of the dash intervals, then we can have the
same error when we subtract-in-a-loop with the phase. The result is that we can
read past the end of the array.

To fix this, we just pin the loop counter, and if we exhaust our intervals, we
just treat the phase as 0. Not precisely the exact answer, but we aren't going
to draw this dash correctly anyway, since it contains massive interval values
that will be imprecise given our current float implementation.

Fixes http://code.google.com/p/chromium/issues/detail?id=140642
Review URL: https://codereview.appspot.com/6458088

git-svn-id: http://skia.googlecode.com/svn/trunk@4959 2bbb7eff-a529-9590-31e7-b0007b416f81
src/effects/SkDashPathEffect.cpp
tests/DrawPathTest.cpp