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

Commit d48aeb19 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: add checks for possible NULL dereferences in hal"

parents ddd4df2a f9f246e6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2302,7 +2302,7 @@ int audio_extn_utils_set_downmix_params(
    int ret = -EINVAL, i = 0, j = 0;
    struct audio_usecase *usecase = NULL;

    if (mm_params == NULL && out != NULL) {
    if (mm_params == NULL || out == NULL) {
        ALOGE("%s:: Invalid mix matrix params", __func__);
        goto exit;
    }
@@ -2314,6 +2314,11 @@ int audio_extn_utils_set_downmix_params(
        goto exit;

    usecase = get_usecase_from_list(out->dev, out->usecase);
    if (usecase == NULL) {
        ALOGE("%s: Invalid usecase", __func__);
        goto exit;
    }

    out->downmix_params.num_output_channels = mm_params->num_output_channels;
    out->downmix_params.num_input_channels = mm_params->num_input_channels;

+6 −2
Original line number Diff line number Diff line
@@ -2797,6 +2797,10 @@ int start_output_stream(struct stream_out *out)
    if (ret == 0) {
        register_out_stream(out);
        if (out->realtime) {
            if (out->pcm == NULL || !pcm_is_ready(out->pcm)) {
                ALOGE("%s: pcm stream not ready", __func__);
                goto error_open;
            }
            ret = pcm_start(out->pcm);
            if (ret < 0)
                goto error_open;
@@ -4897,8 +4901,8 @@ static int in_create_mmap_buffer(const struct audio_stream_in *stream,
    struct stream_in *in = (struct stream_in *)stream;
    struct audio_device *adev = in->dev;
    int ret = 0;
    unsigned int offset1;
    unsigned int frames1;
    unsigned int offset1 = 0;
    unsigned int frames1 = 0;
    const char *step = "";

    pthread_mutex_lock(&adev->lock);