diff options
| author | 2014-05-05 22:48:50 +0000 | |
|---|---|---|
| committer | 2014-05-05 22:48:50 +0000 | |
| commit | 424b093a58c9f428081da991afa347183bf07847 (patch) | |
| tree | 1a31e1ce6c7a77a8692f996c572f03d80be38d09 /libs | |
| parent | 4314ccd1ba9fe773b0fc91f0a08dc536ebce8dfe (diff) | |
| parent | ef923fcfd3db9ca1d7df48273cf9a6258aaf15c2 (diff) | |
am ef923fcf: Merge "fix GraphicBuffer::flatten crash issue when handle is null"
* commit 'ef923fcfd3db9ca1d7df48273cf9a6258aaf15c2':
fix GraphicBuffer::flatten crash issue when handle is null
Diffstat (limited to 'libs')
| -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; } |