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

Commit bd1198d3 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

am: 6ce96089

Change-Id: I3780c6aac9e33477d8b7241d8cba99e8df748953
parents befe5cb0 6ce96089
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) {