1 // Copyright 2016 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef TESTING_LIBFUZZER_FUZZERS_SKIA_PATH_COMMON_H_ 6 #define TESTING_LIBFUZZER_FUZZERS_SKIA_PATH_COMMON_H_ 7 8 #include "third_party/skia/include/core/SkPath.h" 9 10 template <typename T> read(const uint8_t ** data,size_t * size,T * value)11static bool read(const uint8_t** data, size_t* size, T* value) { 12 if (*size < sizeof(T)) 13 return false; 14 15 *value = *reinterpret_cast<const T*>(*data); 16 *data += sizeof(T); 17 *size -= sizeof(T); 18 return true; 19 } 20 21 void BuildPath(const uint8_t** data, 22 size_t* size, 23 SkPath* path, 24 int last_verb); 25 26 #endif // TESTING_LIBFUZZER_FUZZERS_SKIA_PATH_COMMON_H_ 27