summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2015-06-01 13:59:15 -0700
committerDan Stoza <stoza@google.com>2015-06-01 13:59:15 -0700
commit6a04e5fcf67e754b215301fe38a6401db567f4b5 (patch)
treead233cc10bee48bc56b9a65106872fe9284486eb /libs
parentf6f221aa98b195addbd512114e14a376dac276d3 (diff)
downloadframeworks_native-6a04e5fcf67e754b215301fe38a6401db567f4b5.zip
frameworks_native-6a04e5fcf67e754b215301fe38a6401db567f4b5.tar.gz
frameworks_native-6a04e5fcf67e754b215301fe38a6401db567f4b5.tar.bz2
libgui: Propagate error by clearing sp<GB>
Clears the sp<GraphicBuffer> returned by createGraphicBuffer when there is an error during unflattening. Bug: 21498231 Change-Id: I886da4474fc06853cc59188d62044b7d7549126b
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/IGraphicBufferAlloc.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/gui/IGraphicBufferAlloc.cpp b/libs/gui/IGraphicBufferAlloc.cpp
index 09b63a1..3009989 100644
--- a/libs/gui/IGraphicBufferAlloc.cpp
+++ b/libs/gui/IGraphicBufferAlloc.cpp
@@ -59,6 +59,9 @@ public:
if (result == NO_ERROR) {
graphicBuffer = new GraphicBuffer();
result = reply.read(*graphicBuffer);
+ if (result != NO_ERROR) {
+ graphicBuffer.clear();
+ }
// reply.readStrongBinder();
// here we don't even have to read the BufferReference from
// the parcel, it'll die with the parcel.