diff options
author | Jesse Hall <jessehall@google.com> | 2014-05-05 22:45:49 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-05 22:45:50 +0000 |
commit | ef923fcfd3db9ca1d7df48273cf9a6258aaf15c2 (patch) | |
tree | 179dbb11b8272216a2212a10d58ee12a42602c8f | |
parent | 70278fbfe012c1fce3e63a41ffb9feaf1e53a64a (diff) | |
parent | e2d1157381b863a94ccb36a1c6d70cad47e79c1a (diff) | |
download | native-idea133-weekly-release.tar.gz |
Merge "fix GraphicBuffer::flatten crash issue when handle is null"idea133-weekly-release
-rw-r--r-- | libs/ui/GraphicBuffer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp index 96a7188415..c4e4efa1ca 100644 --- a/libs/ui/GraphicBuffer.cpp +++ b/libs/ui/GraphicBuffer.cpp @@ -235,8 +235,10 @@ status_t GraphicBuffer::flatten(void*& buffer, size_t& size, int*& fds, size_t& buffer = reinterpret_cast<void*>(static_cast<int*>(buffer) + sizeNeeded); size -= sizeNeeded; - fds += handle->numFds; - count -= handle->numFds; + if (handle) { + fds += handle->numFds; + count -= handle->numFds; + } return NO_ERROR; } |