hid_report_descriptor_fuzzer.cc 856 B

12345678910111213141516171819202122
  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 "services/device/public/cpp/hid/hid_report_descriptor.h"
  7. #include "services/device/public/mojom/hid.mojom.h"
  8. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  9. device::HidReportDescriptor desc(std::vector<uint8_t>(data, data + size));
  10. std::vector<device::mojom::HidCollectionInfoPtr> top_level_collections;
  11. bool has_report_id;
  12. size_t max_input_report_size;
  13. size_t max_output_report_size;
  14. size_t max_feature_report_size;
  15. desc.GetDetails(&top_level_collections, &has_report_id,
  16. &max_input_report_size, &max_output_report_size,
  17. &max_feature_report_size);
  18. return 0;
  19. }