webp_parser_fuzzertest.cc 685 B

123456789101112131415161718192021222324
  1. // Copyright 2019 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 "base/containers/span.h"
  7. #include "base/logging.h"
  8. #include "media/parsers/vp8_parser.h"
  9. #include "media/parsers/webp_parser.h"
  10. struct Environment {
  11. Environment() { logging::SetMinLogLevel(logging::LOG_FATAL); }
  12. };
  13. Environment* env = new Environment();
  14. // Entry point for LibFuzzer.
  15. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  16. base::span<const uint8_t> encoded_data(data, size);
  17. media::ParseWebPImage(encoded_data);
  18. return 0;
  19. }