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

Commit 006a601f authored by Jesse Hall's avatar Jesse Hall
Browse files

Fix reading NULL Surfaces from Parcels

Writing a NULL Surface was being read as a non-NULL Surface with NULL
mGraphicBufferProducer. Before the SurfaceTextureClient -> Surface
refactoring, you'd get a NULL Surface, and some code relies on that.

Bug: 8291161
Change-Id: I477bfe8882693e53a5f604a3d2c9e3cfe24473b4
parent bbb57f33
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -735,7 +735,7 @@ status_t Surface::writeToParcel(
sp<Surface> Surface::readFromParcel(const Parcel& data) {
sp<Surface> Surface::readFromParcel(const Parcel& data) {
    sp<IBinder> binder(data.readStrongBinder());
    sp<IBinder> binder(data.readStrongBinder());
    sp<IGraphicBufferProducer> bp(interface_cast<IGraphicBufferProducer>(binder));
    sp<IGraphicBufferProducer> bp(interface_cast<IGraphicBufferProducer>(binder));
    return new Surface(bp);
    return bp != NULL ? new Surface(bp): NULL;
}
}


// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------