From 006a601f22b275bcabf608f630b321df027d56d1 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Sat, 2 Mar 2013 16:25:32 -0800 Subject: 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 --- libs/gui/Surface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/gui/Surface.cpp') diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 410ad5da92..950d16a4f2 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -735,7 +735,7 @@ status_t Surface::writeToParcel( sp Surface::readFromParcel(const Parcel& data) { sp binder(data.readStrongBinder()); sp bp(interface_cast(binder)); - return new Surface(bp); + return bp != NULL ? new Surface(bp): NULL; } // ---------------------------------------------------------------------------- -- cgit v1.2.3-59-g8ed1b