Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: ui/gfx/color_transform_fuzzer.cc

Issue 2224023002: Fix unitialized data field in QCMS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forgot actual fuzzer file Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/color_transform_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/color_transform_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698