bool IsValidSize(size_t n) { if (n == 0) { returnfalse;
} // PFFFT only supports transforms for inputs of length N of the form // N = (2^a)*(3^b)*(5^c) where a >= 5, b >=0, c >= 0.
constexpr std::array<int, 3> kFactors = {2, 3, 5};
std::array<int, kFactors.size()> factorization{}; for (size_t i = 0; i < kFactors.size(); ++i) { constint factor = kFactors[i]; while (n % factor == 0) {
n /= factor;
factorization[i]++;
}
} return factorization[0] >= 5 && n == 1;
}
// Entry point for LibFuzzer. extern"C"int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Set the number of FFT points to use |data| as input vector. // The latter is truncated if the number of bytes is not an integer // multiple of the size of one sample (which is either a real or a complex // floating point number). const size_t fft_size = size / kSizeOfOneSample; if (!IsValidSize(fft_size)) { return 0;
}
// Call different PFFFT functions to maximize the coverage.
pffft_transform(pffft_setup, in, out, nullptr, PFFFT_FORWARD);
pffft_zconvolve_accumulate(pffft_setup, out, out, out, 1.f);
pffft_transform_ordered(pffft_setup, in, out, nullptr, PFFFT_BACKWARD);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.