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

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

Merge "MediaPlayerService: Fix binder dereference while connecting to media services"

parents adc615d7 a73342bb
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -685,10 +685,20 @@ sp<MediaPlayerBase> MediaPlayerService::Client::setDataSource_pre(

    sp<IServiceManager> sm = defaultServiceManager();
    sp<IBinder> binder = sm->getService(String16("media.extractor"));
    if (binder == NULL) {
        ALOGE("Unable to connect to media extractor service");
        return NULL;
    }

    mExtractorDeathListener = new ServiceDeathNotifier(binder, p, MEDIAEXTRACTOR_PROCESS_DEATH);
    binder->linkToDeath(mExtractorDeathListener);

    binder = sm->getService(String16("media.codec"));
    if (binder == NULL) {
        ALOGE("Unable to connect to media codec service");
        return NULL;
    }

    mCodecDeathListener = new ServiceDeathNotifier(binder, p, MEDIACODEC_PROCESS_DEATH);
    binder->linkToDeath(mCodecDeathListener);