diff --git a/native/graphics/jni/corpus/webp-color-profile-lossless.webp b/native/graphics/jni/corpus/webp-color-profile-lossless.webp new file mode 100644 index 0000000000000..4fd63d5794ffa Binary files /dev/null and b/native/graphics/jni/corpus/webp-color-profile-lossless.webp differ diff --git a/native/graphics/jni/fuzz_imagedecoder.cpp b/native/graphics/jni/fuzz_imagedecoder.cpp index f2cd1a8f4eb93..015aca70e4e0b 100644 --- a/native/graphics/jni/fuzz_imagedecoder.cpp +++ b/native/graphics/jni/fuzz_imagedecoder.cpp @@ -73,6 +73,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; } - AImageDecoder_decodeImage(decoder.get(), pixels.get(), stride, pixelSize); + while (true) { + int result = AImageDecoder_decodeImage(decoder.get(), pixels.get(), stride, pixelSize); + if (result != ANDROID_IMAGE_DECODER_SUCCESS) break; + + result = AImageDecoder_advanceFrame(decoder.get()); + if (result != ANDROID_IMAGE_DECODER_SUCCESS) break; + } return 0; }