animencoder_fuzzer: no WebPAnimEncoderAssemble check w/nallocfuzz

This function may fail due to allocation failures. Use the
NALLOC_FUZZ_VERSION environment variable to detect the engine. This was
added in:
9c9a9883cc

Change-Id: Ia5b6fd9458ffa1f810152a10ab49a48c75d17687
This commit is contained in:
James Zern 2023-07-06 22:19:12 +00:00
parent 6be9bf8bae
commit b92deba353

View File

@ -164,7 +164,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* const data, size_t size) {
} }
WebPData webp_data; WebPData webp_data;
WebPDataInit(&webp_data); WebPDataInit(&webp_data);
if (!WebPAnimEncoderAssemble(enc, &webp_data)) { // Tolerate failures when running under the nallocfuzz engine as allocations
// during assembly may fail.
if (!WebPAnimEncoderAssemble(enc, &webp_data) &&
getenv("NALLOC_FUZZ_VERSION") == nullptr) {
fprintf(stderr, "WebPAnimEncoderAssemble failed: %s.\n", fprintf(stderr, "WebPAnimEncoderAssemble failed: %s.\n",
WebPAnimEncoderGetError(enc)); WebPAnimEncoderGetError(enc));
WebPAnimEncoderDelete(enc); WebPAnimEncoderDelete(enc);