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

Unified Diff: ui/display/util/edid_parser_fuzzer.cc

Issue 2252643003: ui: Add a libfuzzer based fuzzer for EDID parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/display/util/BUILD.gn ('k') | ui/display/util/fuzz_corpus/internal » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/util/edid_parser_fuzzer.cc
diff --git a/ui/display/util/edid_parser_fuzzer.cc b/ui/display/util/edid_parser_fuzzer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..17367831e0be0791b1e76f8607fd65a694e46054
--- /dev/null
+++ b/ui/display/util/edid_parser_fuzzer.cc
@@ -0,0 +1,28 @@
+// Copyright 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 <vector>
+
+#include "ui/display/util/edid_parser.h"
+#include "ui/gfx/geometry/size.h"
+
+// Entry point for LibFuzzer.
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ std::vector<uint8_t> edid;
+ edid.assign(data, data + size);
+ uint16_t manufacturer_id, product_code;
+ std::string human_readable_name;
+ gfx::Size active_pixel_size, physical_display_size;
+ bool overscan;
+
+ ui::ParseOutputDeviceData(edid, &manufacturer_id, &product_code,
+ &human_readable_name, &active_pixel_size,
+ &physical_display_size);
+
+ ui::ParseOutputOverscanFlag(edid, &overscan);
+ return 0;
+}
« no previous file with comments | « ui/display/util/BUILD.gn ('k') | ui/display/util/fuzz_corpus/internal » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698