diff options
author | Andy McFadden <fadden@android.com> | 2014-03-17 16:48:23 -0700 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2014-03-17 16:48:23 -0700 |
commit | bc96e4714f4cc1ae598f122b3b9f7998c09fe674 (patch) | |
tree | 56021c5a508d6c065c3eb98471625b56dfa65fc4 /libs/ui | |
parent | ce9f107c9d9ad4fdc0ad43ccd545823caa3cf933 (diff) | |
download | frameworks_native-bc96e4714f4cc1ae598f122b3b9f7998c09fe674.zip frameworks_native-bc96e4714f4cc1ae598f122b3b9f7998c09fe674.tar.gz frameworks_native-bc96e4714f4cc1ae598f122b3b9f7998c09fe674.tar.bz2 |
Added null check
Don't dereference "handle" if it's NULL.
Bug 13348578
Change-Id: Ifa6758616c41cf84467af6db29c779d26901a01c
Diffstat (limited to 'libs/ui')
-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 96a7188..c4e4efa 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; } |