OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "ui/gfx/color_space.h" | 9 #include "ui/gfx/color_space.h" |
10 #include "ui/gfx/color_transform.h" | 10 #include "ui/gfx/color_transform.h" |
11 #include "ui/gfx/icc_profile.h" | 11 #include "ui/gfx/icc_profile.h" |
12 | 12 |
13 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | 13 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
14 base::AtExitManager at_exit; | 14 base::AtExitManager at_exit; |
15 gfx::ICCProfile icc = | 15 gfx::ICCProfile icc = |
16 gfx::ICCProfile::FromData(reinterpret_cast<const char*>(data), size); | 16 gfx::ICCProfile::FromData(reinterpret_cast<const char*>(data), size); |
17 gfx::ColorSpace bt709 = gfx::ColorSpace::CreateREC709(); | 17 gfx::ColorSpace bt709 = gfx::ColorSpace::CreateREC709(); |
18 std::unique_ptr<gfx::ColorTransform> t(gfx::ColorTransform::NewColorTransform( | 18 std::unique_ptr<gfx::ColorTransform> t(gfx::ColorTransform::NewColorTransform( |
19 bt709, icc.GetColorSpace(), gfx::ColorTransform::Intent::ABSOLUTE)); | 19 bt709, icc.GetColorSpace(), |
| 20 gfx::ColorTransform::Intent::INTENT_ABSOLUTE)); |
20 gfx::ColorTransform::TriStim tmp(16.0f / 255.0f, 0.5f, 0.5f); | 21 gfx::ColorTransform::TriStim tmp(16.0f / 255.0f, 0.5f, 0.5f); |
21 t->transform(&tmp, 1); | 22 t->transform(&tmp, 1); |
22 return 0; | 23 return 0; |
23 } | 24 } |
OLD | NEW |