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

Commit 98c24211 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adding a corpus that should get the fuzzer deeper into the code."

parents 65d1ee72 990ac03f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ cc_fuzz {
    srcs: [
        "FrameDecoderFuzzer.cpp",
    ],
    corpus: ["corpus/*"],
    defaults: ["libstagefright_fuzzer_defaults"],
}

+8 −5
Original line number Diff line number Diff line
@@ -46,12 +46,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    }

    while (fdp.remaining_bytes()) {
        switch (fdp.ConsumeIntegralInRange<uint8_t>(0, 3)) {
            case 0:
                decoder->init(/*frameTimeUs*/ fdp.ConsumeIntegral<int64_t>(),
                              /*option*/ fdp.ConsumeIntegral<int>(),
                              /*colorFormat*/ fdp.ConsumeIntegral<int>());
        uint8_t switchCase = fdp.ConsumeIntegralInRange<uint8_t>(0, 3);
        switch (switchCase) {
            case 0: {
                int64_t frameTimeUs = fdp.ConsumeIntegral<int64_t>();
                int option = fdp.ConsumeIntegral<int>();
                int colorFormat = fdp.ConsumeIntegral<int>();
                decoder->init(frameTimeUs, option, colorFormat);
                break;
            }
            case 1:
                decoder->extractFrame();
                break;
+385 B

File added.

No diff preview for this file type.