Add mode validation to PtProcRec::init.

BUG=486946

Review URL: https://codereview.chromium.org/1142563003
This commit is contained in:
ochang 2015-05-21 15:44:53 -07:00 committed by Commit bot
parent 5a7cd87bd2
commit 3ece53ed30

View File

@ -443,6 +443,10 @@ static void aa_square_proc(const PtProcRec& rec, const SkPoint devPts[],
// If this guy returns true, then chooseProc() must return a valid proc
bool PtProcRec::init(SkCanvas::PointMode mode, const SkPaint& paint,
const SkMatrix* matrix, const SkRasterClip* rc) {
if ((unsigned)mode > (unsigned)SkCanvas::kPolygon_PointMode) {
return false;
}
if (paint.getPathEffect()) {
return false;
}