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

Commit 1c9259eb authored by Deeraj Soman's avatar Deeraj Soman
Browse files

audio: hal: Fix segfault invalid memory dereferencing

Initialize the structure to avoid it having garbage value.
Garbage value causes segfault during runtime.

Change-Id: I12699ffe810f57f63f08df2f78c2d94443788cbe
parent f0877a9e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -599,6 +599,9 @@ int audio_extn_hw_loopback_create_audio_patch(struct audio_hw_device *dev,
    /* Use an empty patch from patch database and initialze */
    active_loopback_patch = &(audio_loopback_mod->patch_db.loopback_patch[
                                audio_loopback_mod->patch_db.num_patches]);

    memset(active_loopback_patch, 0, sizeof(loopback_patch_t));

    active_loopback_patch->patch_handle_id = PATCH_HANDLE_INVALID;
    active_loopback_patch->patch_state = PATCH_INACTIVE;
    active_loopback_patch->patch_stream.ip_hdlr_handle = NULL;