Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f63c3490 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Improve AImageDecoder fuzzer

Bug: 169137236
Bug: 169139756
Test: this (fuzzer)

Extend the fuzzer to test animations.

Also test a lossless webp, left out of
Ib227639bf8da75f0e8e31e216bc6d1371e24cb75.

Change-Id: I81d35d6fa7d560b33b6a2b5d6c1992cbdd77bc87
parent cc60f0d7
Loading
Loading
Loading
Loading
+42.8 KiB
Loading image diff...
+7 −1
Original line number Diff line number Diff line
@@ -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;
}