chromium/third_party/pdfium/testing/fuzzers/pdf_lzw_fuzzer.cc

// Copyright 2017 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stddef.h>
#include <stdint.h>

#include <vector>

#include "core/fxcodec/gif/lzw_decompressor.h"
#include "core/fxcrt/compiler_specific.h"
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/numerics/safe_conversions.h"
#include "core/fxcrt/span.h"

// Between 2x and 5x is a standard range for LZW according to a quick
// search of papers. Running up to 10x to catch any niche cases.
constexpr uint32_t kMinCompressionRatio =;
constexpr uint32_t kMaxCompressionRatio =;

static constexpr size_t kMaxFuzzBytes =;  // 1 GB.

void LZWFuzz(pdfium::span<const uint8_t> src_buf,
             uint8_t color_exp,
             uint8_t code_exp) {}

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {}