OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "base/logging.h" |
10 #include "ui/display/util/edid_parser.h" | 11 #include "ui/display/util/edid_parser.h" |
11 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
12 | 13 |
13 struct Environment { | 14 struct Environment { |
14 Environment() { | 15 Environment() { |
15 logging::SetMinLogLevel(logging::LOG_FATAL); | 16 logging::SetMinLogLevel(logging::LOG_FATAL); |
16 } | 17 } |
17 }; | 18 }; |
18 | 19 |
19 Environment* env = new Environment(); | 20 Environment* env = new Environment(); |
20 | 21 |
21 // Entry point for LibFuzzer. | 22 // Entry point for LibFuzzer. |
22 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | 23 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
23 std::vector<uint8_t> edid; | 24 std::vector<uint8_t> edid; |
24 edid.assign(data, data + size); | 25 edid.assign(data, data + size); |
25 uint16_t manufacturer_id, product_code; | 26 uint16_t manufacturer_id, product_code; |
26 std::string human_readable_name; | 27 std::string human_readable_name; |
27 gfx::Size active_pixel_size, physical_display_size; | 28 gfx::Size active_pixel_size, physical_display_size; |
28 bool overscan; | 29 bool overscan; |
29 | 30 |
30 display::ParseOutputDeviceData(edid, &manufacturer_id, &product_code, | 31 display::ParseOutputDeviceData(edid, &manufacturer_id, &product_code, |
31 &human_readable_name, &active_pixel_size, | 32 &human_readable_name, &active_pixel_size, |
32 &physical_display_size); | 33 &physical_display_size); |
33 | 34 |
34 display::ParseOutputOverscanFlag(edid, &overscan); | 35 display::ParseOutputOverscanFlag(edid, &overscan); |
35 return 0; | 36 return 0; |
36 } | 37 } |
OLD | NEW |