| Index: ui/gfx/color_transform_fuzzer.cc
|
| diff --git a/ui/gfx/color_transform_fuzzer.cc b/ui/gfx/color_transform_fuzzer.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9732f8e3b2f40e55a6a44bc6e1c225683093ca28
|
| --- /dev/null
|
| +++ b/ui/gfx/color_transform_fuzzer.cc
|
| @@ -0,0 +1,23 @@
|
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include <stddef.h>
|
| +#include <stdint.h>
|
| +
|
| +#include "base/at_exit.h"
|
| +#include "ui/gfx/color_space.h"
|
| +#include "ui/gfx/color_transform.h"
|
| +#include "ui/gfx/icc_profile.h"
|
| +
|
| +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
| + base::AtExitManager at_exit;
|
| + gfx::ICCProfile icc =
|
| + gfx::ICCProfile::FromData(reinterpret_cast<const char*>(data), size);
|
| + gfx::ColorSpace bt709 = gfx::ColorSpace::CreateREC709();
|
| + std::unique_ptr<gfx::ColorTransform> t(gfx::ColorTransform::NewColorTransform(
|
| + bt709, icc.GetColorSpace(), gfx::ColorTransform::Intent::ABSOLUTE));
|
| + gfx::ColorTransform::TriStim tmp(16.0f / 255.0f, 0.5f, 0.5f);
|
| + t->transform(&tmp, 1);
|
| + return 0;
|
| +}
|
|
|