OSDN Git Service
(root)
/
android-x86
/
frameworks-native.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ce9f107
)
Added null check
author
Andy McFadden
<fadden@android.com>
Mon, 17 Mar 2014 23:48:23 +0000
(16:48 -0700)
committer
Andy McFadden
<fadden@android.com>
Mon, 17 Mar 2014 23:48:23 +0000
(16:48 -0700)
Don't dereference "handle" if it's NULL.
Bug
13348578
Change-Id: Ifa6758616c41cf84467af6db29c779d26901a01c
libs/ui/GraphicBuffer.cpp
patch
|
blob
|
history
diff --git
a/libs/ui/GraphicBuffer.cpp
b/libs/ui/GraphicBuffer.cpp
index
96a7188
..
c4e4efa
100644
(file)
--- 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;
}