Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating with OSS-Fuzz #28

Open
Google-Autofuzz opened this issue May 22, 2019 · 1 comment
Open

Integrating with OSS-Fuzz #28

Google-Autofuzz opened this issue May 22, 2019 · 1 comment

Comments

@Google-Autofuzz
Copy link

Greetings crunch contributors/maintainers/enthusiasts,

We’re reaching out because your project is an important part of the open source ecosystem, and we’d like to invite you to integrate with our fuzzing service, OSS-Fuzz. OSS-Fuzz is a free fuzzing infrastructure you can use to identify security vulnerabilities and stability bugs in your project. OSS-Fuzz will:

  • Continuously run all the fuzzers you write.
  • Alert you when it finds issues.
  • Automatically close issues after they’ve been fixed by a commit.

Many widely used open source projects like OpenSSL, FFmpeg, LibreOffice, and ImageMagick are fuzzing via OSS-Fuzz, which helps them find and remediate critical issues.

Even though typical integrations can be done in < 100 LoC, we have a reward program in place which aims to recognize folks who are not just contributing to open source, but are also working hard to make it more secure.

We want to stress that anyone who meets the eligibility criteria and integrates a project with OSS-Fuzz is eligible for a reward.

To help you getting started, we attached our internal fuzzer for your project that you are welcome to use directly, or to use it as a starting point.

If you're not interested in integrating with OSS-Fuzz, it would be helpful for us to understand why—lack of interest, lack of time, or something else—so we can better support projects like yours in the future.

If we’ve missed your question in our FAQ, feel free to reply or reach out to us at [email protected].

Thanks!

The OSS-Fuzz Team


#include <cstddef>
#include <cstdint>
#include <string>
#include "third_party/crunch/inc/crnlib.h"
#include "third_party/crunch/inc/dds_defs.h"

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  crn_uint32 crn_size = static_cast<crn_uint32>(size);
  void *dds = crn_decompress_crn_to_dds(data, crn_size);
  if (!dds) {
    return 0;
  }
  crn_texture_desc tex_desc;

  // See crnlib.h where cCRNMaxFaces and cCRNMaxLevels are defined for details
  // on the library/file limits used within crunch.
  crn_uint32 *images[cCRNMaxFaces * cCRNMaxLevels];
  bool success = crn_decompress_dds_to_images(dds, crn_size, images, tex_desc);
  crn_free_block(dds);
  if (!success) {
    return 0;
  }
  crn_free_all_images(images, tex_desc);
  return 0;
}
@richgel999
Copy link
Collaborator

Hi - Thanks! I'll find some time to look into this. I suspect crunch's transcoder has issues passing fuzz tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants