am 006a601f: Fix reading NULL Surfaces from Parcels

* commit '006a601f22b275bcabf608f630b321df027d56d1':
  Fix reading NULL Surfaces from Parcels
This commit is contained in:
Jesse Hall 2013-03-04 21:50:23 +00:00 committed by Android Git Automerger
commit 54a1faa7ca

View File

@ -735,7 +735,7 @@ status_t Surface::writeToParcel(
sp<Surface> Surface::readFromParcel(const Parcel& data) {
sp<IBinder> binder(data.readStrongBinder());
sp<IGraphicBufferProducer> bp(interface_cast<IGraphicBufferProducer>(binder));
return new Surface(bp);
return bp != NULL ? new Surface(bp): NULL;
}
// ----------------------------------------------------------------------------