skia2/fuzz/FuzzPathop.cpp
Cary Clark 91390c8ace pathmeasure fuzzer
R=kjlubick@google.com, reed@google.com
Bug: skia:
Change-Id: I16a8b09312e5d1d1783bd6a4b791636ad8f63889
Reviewed-on: https://skia-review.googlesource.com/113165
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-03-12 15:29:18 +00:00

28 lines
596 B
C++

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Fuzz.h"
#include "FuzzCommon.h"
#include "SkPath.h"
#include "SkPathOps.h"
const int kLastOp = SkPathOp::kReverseDifference_SkPathOp;
DEF_FUZZ(Pathop, fuzz) {
SkOpBuilder builder;
uint8_t stragglerOp;
fuzz->next(&stragglerOp);
SkPath path;
BuildPath(fuzz, &path, SkPath::Verb::kDone_Verb);
builder.add(path, static_cast<SkPathOp>(stragglerOp % (kLastOp + 1)));
SkPath result;
builder.resolve(&result);
}