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

Commit 13c2b9b5 authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Guard against crash due to null surface" into pi-dev

parents 691358ac c1cddb57
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -6777,9 +6777,14 @@ void ACodec::LoadedState::onSetInputSurface(const sp<AMessage> &msg) {

    sp<RefBase> obj;
    CHECK(msg->findObject("input-surface", &obj));
    if (obj == NULL) {
        ALOGE("[%s] NULL input surface", mCodec->mComponentName.c_str());
        mCodec->mCallback->onInputSurfaceDeclined(BAD_VALUE);
        return;
    }

    sp<PersistentSurface> surface = static_cast<PersistentSurface *>(obj.get());
    mCodec->mGraphicBufferSource = surface->getBufferSource();

    status_t err = setupInputSurface();

    if (err == OK) {