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

Commit 6ce96089 authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

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

am: 13c2b9b5

Change-Id: I368bf057381d8bbcc6e8491dc158aff25401a4df
parents 14034530 13c2b9b5
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) {