edid_parser_fuzzer.cc 746 B

1234567891011121314151617181920212223242526272829
  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
  3. // found in the LICENSE file.
  4. #include <stddef.h>
  5. #include <stdint.h>
  6. #include <vector>
  7. #include "base/logging.h"
  8. #include "ui/display/util/edid_parser.h"
  9. #include "ui/gfx/geometry/size.h"
  10. struct Environment {
  11. Environment() {
  12. logging::SetMinLogLevel(logging::LOG_FATAL);
  13. }
  14. };
  15. Environment* env = new Environment();
  16. // Entry point for LibFuzzer.
  17. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  18. std::vector<uint8_t> edid;
  19. edid.assign(data, data + size);
  20. // Ctor already parses |edid|, which is what we want here.
  21. display::EdidParser edid_parser(edid);
  22. return 0;
  23. }