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

Commit a7617672 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 e3d2102d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -159,6 +159,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;
    }