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

Commit 5b6968c8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes from topic "media_player_service_fuzzer" am: 7681f87c

parents 038ad4db 7681f87c
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@ license {
    ],
}

cc_defaults {
    name: "libmediaplayerservice_defaults",
filegroup {
    name: "libmediaplayerservice_sources",

    srcs: [
        "ActivityManager.cpp",
@@ -31,6 +31,14 @@ cc_defaults {
        "StagefrightRecorder.cpp",
        "TestPlayerStub.cpp",
    ],
}

cc_defaults {
    name: "libmediaplayerservice_defaults",

    srcs: [
        ":libmediaplayerservice_sources",
    ],

    shared_libs: [
        "android.hardware.media.c2@1.0",
@@ -84,8 +92,6 @@ cc_defaults {
        "framework-permission-aidl-cpp",
    ],

    local_include_dirs: ["include"],

    cflags: [
        "-Werror",
        "-Wno-error=deprecated-declarations",
@@ -116,4 +122,6 @@ cc_library {
    export_include_dirs: [
        ".",
    ],

    local_include_dirs: ["include"],
}
+23 −0
Original line number Diff line number Diff line
@@ -139,3 +139,26 @@ cc_fuzz {
        "libstagefright_httplive",
    ],
}

cc_fuzz {
    name: "media_player_service_fuzzer",
    defaults: [
        "service_fuzzer_defaults",
        "libmediaplayerservice_defaults",
        "fuzzer_disable_leaks",
    ],
    srcs: [
        "media_player_service_fuzzer.cpp",
    ],
    fuzz_config: {
        cc: [
            "kyslov@google.com",
            "ibaker@google.com",
        ],
        triage_assignee: "waghpawan@google.com",
    },
    cflags: [
        "-DFUZZ_MODE_MEDIA_PLAYER_SERVICE",
    ],
    include_dirs: ["frameworks/av/media/libmediaplayerservice/"],
}
+29 −0
Original line number Diff line number Diff line
/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <fuzzbinder/libbinder_driver.h>
#include <fuzzer/FuzzedDataProvider.h>

#include <MediaPlayerService.h>

using android::fuzzService;
using android::MediaPlayerService;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    auto service = MediaPlayerService::createForFuzzTesting();
    fuzzService(service, FuzzedDataProvider(data, size));
    return 0;
}