jpeg_parser_picture_fuzzertest.cc 594 B

12345678910111213141516171819202122
  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/logging.h"
  7. #include "media/parsers/jpeg_parser.h"
  8. struct Environment {
  9. Environment() { logging::SetMinLogLevel(logging::LOG_FATAL); }
  10. };
  11. Environment* env = new Environment();
  12. // Entry point for LibFuzzer.
  13. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  14. media::JpegParseResult result;
  15. ParseJpegPicture(data, size, &result);
  16. return 0;
  17. }