Bug 1255062 - disallow multiple moveTos in SkPath::isRectContour. r=ethlin
authorLee Salzman <lsalzman@mozilla.com>
Fri, 27 May 2016 21:12:25 -0400
changeset 324433 b3b8576fae4d81364479a2addd97cb0ff831a3db
parent 324432 4c907bc970305e4d976eb9de164c297fb050525f
child 324434 351a2e0209b750bd4e2094473d0b4bd341fb2a40
push id9671
push userraliiev@mozilla.com
push dateMon, 06 Jun 2016 20:27:52 +0000
treeherdermozilla-aurora@cea65ca3d0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersethlin
bugs1255062
milestone49.0a1
Bug 1255062 - disallow multiple moveTos in SkPath::isRectContour. r=ethlin
gfx/skia/skia/src/core/SkPath.cpp
--- a/gfx/skia/skia/src/core/SkPath.cpp
+++ b/gfx/skia/skia/src/core/SkPath.cpp
@@ -499,16 +499,19 @@ bool SkPath::isRectContour(bool allowPar
             case kCubic_Verb:
                 return false; // quadratic, cubic not allowed
             case kMove_Verb:
                 if (allowPartial && !autoClose && firstDirection) {
                     insertClose = true;
                     *currVerb -= 1;  // try move again afterwards
                     goto addMissingClose;
                 }
+                if (pts != *ptsPtr) {
+                    return false;
+                }
                 last = *pts++;
                 closedOrMoved = true;
                 break;
             default:
                 SkDEBUGFAIL("unexpected verb");
                 break;
         }
         *currVerb += 1;