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

Commit 8d3972e6 authored by Lucas Gomez Jimenez's avatar Lucas Gomez Jimenez Committed by Steve Kondik
Browse files

Fix in effectCallback to avoid sending callbacks to dead objects

This issue can be easily reproduced by killing an application that
is playing audio using one or more audio effects.

Change-Id: I5f90c65c58d9f2df0737eeed2fbbb0c43aaa0f81
parent 122d76e9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -162,6 +162,15 @@ static void effectCallback(int event, void* user, void *info) {
        ALOGV("EVENT_PARAMETER_CHANGED");
       break;
    case AudioEffect::EVENT_ERROR:
        if (info == 0) {
            ALOGW("EVENT_ERROR info == NULL");
            goto effectCallback_Exit;
        }
        status_t status = *(status_t *)info;
        if (status == DEAD_OBJECT) {
            ALOGE("effectCallback: Client died, no need to send callback");
            goto effectCallback_Exit;
        }
        ALOGW("EVENT_ERROR");
        break;
    }