Imported Upstream version 0.9.0
[platform/upstream/libjxl.git] / tools / color_encoding_fuzzer.cc
1 // Copyright (c) the JPEG XL Project Authors. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file.
5
6 #include <string>
7
8 #include "lib/extras/dec/color_description.h"
9
10 namespace jpegxl {
11 namespace tools {
12
13 int TestOneInput(const uint8_t* data, size_t size) {
14   std::string description(reinterpret_cast<const char*>(data), size);
15   JxlColorEncoding c;
16   (void)jxl::ParseDescription(description, &c);
17
18   return 0;
19 }
20
21 }  // namespace tools
22 }  // namespace jpegxl
23
24 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
25   return jpegxl::tools::TestOneInput(data, size);
26 }