summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2014-03-17 16:48:23 -0700
committerAndy McFadden <fadden@android.com>2014-03-17 16:48:23 -0700
commitbc96e4714f4cc1ae598f122b3b9f7998c09fe674 (patch)
tree56021c5a508d6c065c3eb98471625b56dfa65fc4 /libs/ui
parentce9f107c9d9ad4fdc0ad43ccd545823caa3cf933 (diff)
downloadframeworks_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.cpp6
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;
}